Maik Beckmann | 21 May 09:53

Re: tuple type question

Am Mittwoch 21 Mai 2008 08:42:34 schrieb Hansi:
> Noah Roberts schrieb:
> > #include <boost/tuple/tuple.hpp>
> > #include <string>
> > #include <iostream>
> >
> > template < typename T1, typename T2 >
> > struct Test
> > {
> >    typedef boost::tuple<T1,T2> tuple_t;
> >    tuple_t tup;
> >
> >    enum Members { NAME, VALUE };
> >
> >    typename boost::tuples::element<NAME, tuple_t>::type name() { return
> > tup.get<NAME>(); }

This code is almost correct :o) .  Try the attached File.

> this version doesn't work with my compiler (msvc8.0). I get the error:
>
> error C2899:typename cannot be used outside a template declaration
>
> But this would be the preferred version for me. Have you an idea how I
> can solve this?

Best,
 -- Maik

Attachment (main.cpp): text/x-c++src, 686 bytes
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Gmane