Boost logo

Boost Users :

Subject: Re: [Boost-users] large variant performance compared (50 elements)
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-01-17 19:35:44


On 01/17/11 15:24, Larry Evans wrote:
> On 01/17/11 14:18, Paul wrote:
>> la> [snip]
>>> Could you post a test driver showing the problem.
>>> I'd like to see how:
>>
>> In rough (but working) code:
>>
> However, it appears to need, at least, the #includes:
>
> #include <boost/shared_ptr.hpp>
> #include <boost/mpl/vector.hpp>
> #include <boost/preprocessor/cat.hpp>
> #include <boost/preprocessor/iteration/local.hpp>
> #include <boost/test/minimal.hpp>
>
> Anything else?
>
>> class CVisitBinary
>> : public static_visitor<bool>
> Is this the variant static_visitor or the one from your
> previous post:
>
> http://article.gmane.org/gmane.comp.lib.boost.user/65156
>
> ?
> [snip]
>> template<typename Typelist, typename ElementType1, typename ElementType2>
>> void TestVariantBinary()
>> {
>> typedef Layout::make_variant_over<Typelist>::type variant_t;
>
> Is Layout a new namespace? I don't see it in this post or the previous
> one?
[snip]
The two attached files get me closer to a compilation.
Two significant changes to the originals:

  1) in assign_variant(,true), I had to disable the BOOST_STATIC_ASSERT
     because if was always causing a compiler error.

  2) I had to forward declare:

       CLoPtrVariant(const CLoPtrVariant<Typelist2>& rOperand)

     because the body used CConvertVariant which hadn't been declared
     yet.

However, I'm still getting a compile error with gcc4.5.1. A partial
list of the compilation output is also attached.

Any ideas what's going wrong?

  -Larry






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