TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: DARIN MCBRIDE
from: JERRY COFFIN
date: 1997-07-28 09:50:00
subject: Mutually class definition.

On (26 Jul 97) Darin Mcbride wrote to Jerry Coffin...
 CS> I want to define two classes like the following:
 CS> class A
 CS> {
 CS>    A(int a) {  };
 CS>    B func1() { return B(1); };
 CS> }
 CS> class B
 CS> {
 CS>   B(int a) {  };
 CS>   A func2() { return A(1); };
 CS> }
 DM> I'd say you can't do it.
Oops - you're right.  I glanced at the syntactical problem but didn't
really think about the whole problem.  To accomplish this general sort
of thing, you'd have to return a pointer to the incomplete type rather
than an instance of the incomplete type.
    Later,
    Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.