Boost logo

Boost :

From: Giovanni Bajo (giovannibajo_at_[hidden])
Date: 2002-07-09 20:03:02

----- Original Message -----
From: "Itay" <itay_maman_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.devel
To: <boost_at_[hidden]>
Sent: Wednesday, July 10, 2002 2:31 AM
Subject: [boost] boost::variant 0.2 (was: Yet another variant class)

> I just uploaded the recent version of boost::variant to the file section
> ( This
> version has been successfully tested on GCC 3.0.4, MSVC 6.

rdsl.hpp: missing "typename" keyword on line 820.
variant.hpp: missing "typename" keyword on lines 80, 338.
variant.hpp: missing "template" keyword before all the nested template
accesses. Just look for all "::inner<" occurrences and substitute with
"::template inner<"

variant.hpp has also another error: the nested class/unions can't access the
typedefs declared in the enclosing class. This affects inner_union and
type_desc_helper (within stack_holder). I fixed inner_union moving the
typedefs within the union, and making the union friend (so that it can
access private member t_self::align):

   union inner_union;
   friend union inner_union;

      union inner_union
    typedef stack_holder<Sequence> t_self;

    typedef typename type_with_alignment<(align > 8 ? 8 : align)>::type
    typedef typename type_with_alignment<t_self::align>::type t_aligner;

#endif //BOOST_MSVC

    typedef char t_buffer[max_size];

   t_aligner aligner_;
         t_buffer buf_;
      }; //inner_union

   typedef inner_union::t_aligner t_aligner;
   typedef inner_union::t_buffer t_buffer;

I don't know if this solution works for MSVC6 as well. type_desc_helper is
much easier to fix, just change the occurrence of t_sequence to Sequence
(the template parameters of the enclosing class do have visibiliy in the
nested classes).

Finally, Comeau couldn't still compile the code due to an internal problem
(it generates symbol names too long for VC to handle them!). MSVC7 just ICEd
on variant.hpp:293 and I couldn't fix it with some stupid workaround I came
up with, but I'm no MSVC expert.

Giovanni Bajo

Boost list run by bdawes at, gregod at, cpdaniel at, john at