Can I declare a nested class but define afterwords?
I am getting error on doing this. Please suggest a way out if we can do this.Code:class a { public: class b; }; class a::b { };
Can I declare a nested class but define afterwords?
I am getting error on doing this. Please suggest a way out if we can do this.Code:class a { public: class b; }; class a::b { };
It is possible and part of the typical PIMPL pattern implementation.
What error do you get?
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
its legal but some compilers dont like it.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
error reads
i am compiling it on turbo c++Code:multiple declaration of a::b
sorry, i am not able to find it on faq
What version of Turbo C++?
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
I am using turbo c/c++ 3.0
error reads
Code:
multiple declaration of a::b
i am compiling it on turbo c++3.0
That's a horribly outdated compiler, known not to support any kind of nested classes.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law