possible bug

Jimen Ching jching@flex.com
Sat Feb 14 19:54:00 GMT 1998


The code below causes compile errors.  If you define USE_T, a different
set of errors appear.  What is the correct way of accessing a nested
type?  Thanks in advance...

--jc

-----------------------------
template<class T>
struct container
        {
        typedef T value_type;
#if defined(USE_T)
        typename T::data_type data_type;
        typename T::data_type::nested_type nested_type;
#else
        typename value_type::data_type data_type;
        typename data_type::nested_type nested_type;
#endif
        nested_type n_type;
        container(const nested_type &nt) : n_type(nt) {}
        ~container() {}
        };

struct data { typedef int nested_type; };
struct value { typedef data data_type; };

int main()
        {
        container<value> value_container(0);
        return 0;
        }
-------------------------
--
Jimen Ching (WH6BRR)      jching@flex.com     wh6brr@uhm.ampr.org




More information about the Gcc-bugs mailing list