[Qt-interest] tracking uniqueness

Oliver Heins heins at sopos.org
Sat Apr 24 10:10:29 CEST 2010


Andreas Pakulat <apaku at gmx.de> writes:

> You seem to have a bit of misconception about this. There is no Editor
> instance in your code. All you do is declare a class and a nested class,
> both can be used without an instance of the other as far as your example
> goes. In particular, this:
>
> class Editor
> {
> public:
>   class Token
>   {
>   };
> };
>
> Editor::Token t;
>
> is perfectly valid compiling code. And there's no instance of Editor
> generated here, there's only a single instance of Token.

So it's not possible in C++ to describe the idea: »Every instance of
Token is held by an instance of Editor«?

 olli



More information about the Qt-interest-old mailing list