flyweight with fusion::map = error C3066

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
Is there any fundamental reason why the following code generate this
error? The code compile when the leaf is a "struct" type rather than
boost::fusion::map type.
Regards
Francois
#include

Cote, Francois (SGBM
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_visitorstd::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.recursi... 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
participants (2)
-
Cote, Francois (SGBM)
-
Joaquin M Lopez Munoz