This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/31954] template function cannot create object of forward declared class



------- Comment #2 from fang at csl dot cornell dot edu  2007-05-16 20:56 -------
I concur.  If you want to forcibly delay the dependence on the complete type
until instantiation time, you could use a nested typedef in the class template,
like:

class NonDependent;

template <class X>
struct foo {
  typedef NonDependent Bar;
};

class NonDependent { ... };

and then in members of foo, refer to "typename foo<X>::Bar".


-- 

fang at csl dot cornell dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fang at csl dot cornell dot
                   |                            |edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31954


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]