Boost logo

Boost Users :

From: Maik Beckmann (beckmann.maik_at_[hidden])
Date: 2008-05-21 03:53:17


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




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net