Boost logo

Boost Users :

Subject: Re: [Boost-users] flyweight with fusion::map = error C3066
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2010-05-04 16:04:47


Cote, Francois (SGBM <Francois.Cote <at> santandergbm.com> writes:

>
> Dear All,
>
> I’m trying to create a composite structure of flyweight inspired
> by the example boost_1_41_0\libs\flyweight\example\composite.cpp.
>
> However, I need the leaf of my composite pattern to be a boost::fusion::map
> type. I’m getting the following error:
>
> \boost\variant\variant.hpp(825) : error C3066: there are multiple ways
> that an object of this type can be called with these arguments
>
> [...]
>
> struct portfolio_hasher: boost::static_visitor<std::size_t>
> {
>   [...]
>
>    std::size_t operator()(
> const boost::recursive_wrapper<portfolio>& pf_w)const
>    {

Here's the problem. The signature of this operator() overload
should be

    std::size_t operator()(const portfolio& pf)const;

That is, recursive_wrapper must be omitted, as documented in

  http://www.boost.org/doc/html/variant/tutorial.html#variant.tutorial.recursive

The example at Boost.Flyweight happens to work by chance.
Thanks for spotting this, I'll correct the code asap.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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