Boost logo

Boost Users :

Subject: Re: [Boost-users] large variant performance compared (50 elements)
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-01-27 20:32:40


On 01/27/11 13:19, Paul wrote:
> Hopefully attached header will pass your test?
> Since i heave no gcc or python environment currently available it will
> be more difficult for me to test this. I'm curious whether you find the
> same improvement between '''our''' variant compared to the
> boost::variant as we have seen on our project.
> Paul

Paul, it still does not compile with gcc.
My code attached to earlier post forward declared:

    template<typename Typelist2>
    CLoPtrVariant(const CLoPtrVariant<Typelist2>& rOperand)
    ;

this was necessary because the body used:

      CConvertVariant<Typelist> convert(*this);

which had not been declare yet. Only after CConvertVariant was declared
could g++ compile the body of:

    template<typename Typelist2>
    CLoPtrVariant(const CLoPtrVariant<Typelist2>& rOperand)

Please, start from the code I provided earler which *does* separate
the declaration of:

    template<typename Typelist2>
    CLoPtrVariant(const CLoPtrVariant<Typelist2>& rOperand)

from it's defintiion, which occurs *after* the declaraion of:

  template<typename Typelist>
  CConvertVariant

The code you recently posted does *not* sepearte the declaration from
the definition of:

    template<typename Typelist2>
    CLoPtrVariant(const CLoPtrVariant<Typelist2>& rOperand)

the same applies to another class, I think that class has wrapper in
it's name.

Also, use typename within templates typedef, as shown in my earlier
post.

Then I may be able to eompile the code with g++ *and* the code will be
more portable.

Since g++ is freely available, I'm wondering why you just can't install
it on your machine and compilee your code with g++ to make sure your
code is portable to g++. Is there come company which you work for
that has some policy which forbids that?

To summarize, why haven't you started your modification from the code
I provided earlier which did sepearte the declaration from the
definition of:

    template<typename Typelist2>
    CLoPtrVariant(const CLoPtrVariant<Typelist2>& rOperand)

and which did provide the needed typename prefixes to the several
typdefs where that was required by g++ (and I assume) by the c++ standard).

-regards
 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