[Bug c++/22227] New: g++ 4.0.0 has issues with the typedef of reference

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Jun 29 00:00:00 GMT 2005


"jcurran2 at uiuc dot edu" <gcc-bugzilla@gcc.gnu.org> writes:

| G++ thinks that a nested type is a nested class and it expects a constructor, 
| destructor, or type conversion before the object referenced in the class is 
| processed when compiling a function of a nested type defined in the header file 
| of a templated class.
| 
| Header file below
| 
| //C++ STL classes have 12 type definitions, so that every class
| //   defines the following type names as nested types:
| //
| //      value_type, pointer, reference, const_pointer, const_reference
| //        iterator, const_iterator, reverse_iterator, const_reverse_iterator
| //          allocator_type, size_type, diference_type
| 
| typedef Etype& reference; //list<...>::value_type to access
|                           //whatever type this list holds
| 
| 
| template <class Etype>
| typename list<Etype>::reference 
|                         list<Etype>::const_iterator*() const

I don't understand what that line is supposed to mean.  It does not
look C++ to me.

-- Gaby



More information about the Gcc-bugs mailing list