TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JERRY COFFIN
from: THOMAS MAEDER
date: 1997-07-26 13:26:00
subject: Mutually class definition

JC>  CS> class A
JC>  CS> {
JC>  CS>    A(int a) {  };
JC>  CS>    B func1() { return B(1); };
JC>  CS> }
JC>  CS> class B
JC>  CS> {
JC>  CS>   B(int a) {  };
JC>  CS>   A func2() { return A(1); };
JC>  CS> }
This is not possible. What are you trying to model?
JC> class B;
JC> class A {
JC>     B func1() { return B(1); }  // 4
JC> };
JC> class B {
JC>     B(int a) { /* ... */ }
JC> };
My compiler says: 
Error: noname00.cpp(4,3):Cannot cast from  'int'  to 'B'
Thomas
---
 þ MM 1.0 #0113 þ Read my chips: No new upgrades!
---------------
* Origin: McMeier & Son BBS (2:301/138)

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™.