Boost logo

Boost Users :

Subject: [Boost-users] Boost.fusion 1.42 / Gcc 4.5: what is this error trying to tell me? (Works with Gcc 4.4)
From: Joost Kraaijeveld (J.Kraaijeveld_at_[hidden])
Date: 2011-03-06 04:01:09


Hi,

I have code that compiles OK with Gcc 4.4 but fails with 4.5 and I
cannot understand what the error I get from the compiler means. Maybe
someone here can give me a suggestion?

The error:

In file included from /usr/include/boost/fusion/algorithm/query/find.hpp:13:0,
                 from /usr/include/boost/fusion/sequence/intrinsic/has_key.hpp:12,
                 from /usr/include/boost/fusion/sequence/intrinsic.hpp:16,
                 from /usr/include/boost/fusion/sequence.hpp:12,
                 from ../../../library/../include/Danu/DanuModelObjects/User.hpp:11,
                 from ../../../library/../include/Danu/DanuViewObjects/UserViewObject.hpp:12,
                 from ../../../library/../include/Danu/DanuViewObjects/UserDialog.hpp:15,
                 from ../../../library/../include/Danu/DanuModelObjectsFactory/UserCreatorFunction.hpp:10,
                 from ../../../library/DanuModelObjectsFactory/UserCreatorFunction.cpp:7:
/usr/include/boost/fusion/iterator/key_of.hpp: In instantiation of 'boost::fusion::result_of::key_of<mpl_::arg<1> >':
/usr/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:85:88: instantiated from 'const int boost::mpl::aux::template_arity_impl<boost::is_same<boost::fusion::result_of::key_of<mpl_::arg<1> >, Danu::UserCreator::objectId>, 1>::value'
/usr/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:93:261: instantiated from 'const int boost::mpl::aux::template_arity<boost::is_same<boost::fusion::result_of::key_of<mpl_::arg<1> >, Danu::UserCreator::objectId> >::value'
/usr/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:98:30: instantiated from 'boost::mpl::aux::template_arity<boost::is_same<boost::fusion::result_of::key_of<mpl_::arg<1> >, Danu::UserCreator::objectId> >'
/usr/include/boost/fusion/algorithm/query/detail/find_if.hpp:184:9: instantiated from 'boost::fusion::detail::static_find_if<boost::fusion::basic_iterator<boost::fusion::map_iterator_tag, boost::fusion::map<boost::fusion::pair<Danu::UserCreator::objectId, Danu::ObjectId>, boost::fusion::pair<Danu::UserCreator::userId, int>, boost::fusion::pair<Danu::UserCreator::userName, std::basic_string<char> >, boost::fusion::pair<Danu::UserCreator::password, std::basic_string<char> >, boost::fusion::pair<Danu::UserCreator::firstName, std::basic_string<char> >, boost::fusion::pair<Danu::UserCreator::infix, std::basic_string<char> >, boost::fusion::pair<Danu::UserCreator::lastName, std::basic_string<char> > >::category, const Danu::UserCreator::UserCreationArguments, 0>, boost::fusion::basic_iterator<boost::fusion::map_iterator_tag, boost::fusion::map<boost::fusion::pair<Danu::UserCreator::objectId, Danu::ObjectId>, boost::fusion::pair<Danu::UserCreator::userId, int>, boost::fusion::pair<Danu::UserCreator::userName, std::basic_string<char> >, boost::fusion::pair<Danu::UserCreator::password, std::basic_string<char> >, boost::fusion::pair<Danu::UserCreator::firstName, std::basic_string<char> >, boost::fusion::pair<Danu::UserCreator::infix, std::basic_string<char> >, boost::fusion::pair<Danu::UserCreator::lastName, std::basic_string<char> > >::category, const Danu::UserCreator::UserCreationArguments, 7>, boost::is_same<boost::fusion::result_of::key_of<mpl_::arg<1> >, Danu::UserCreator::objectId> >'
/usr/include/boost/fusion/algorithm/query/find.hpp:46:43: instantiated from 'boost::fusion::result_of::find<const Danu::UserCreator::UserCreationArguments, Danu::UserCreator::objectId>'
/usr/include/boost/fusion/sequence/intrinsic/at_key.hpp:37:17: instantiated from 'boost::fusion::extension::at_key_impl<boost::fusion::map_tag>::apply<const Danu::UserCreator::UserCreationArguments, Danu::UserCreator::objectId>'
/usr/include/boost/fusion/sequence/intrinsic/at_key.hpp:70:9: instantiated from 'boost::fusion::result_of::at_key<const Danu::UserCreator::UserCreationArguments, Danu::UserCreator::objectId>'
../../../library/DanuModelObjectsFactory/UserCreatorFunction.cpp:40:83: instantiated from here
/usr/include/boost/fusion/iterator/key_of.hpp:38:9: error: invalid use of incomplete type 'struct boost::fusion::extension::key_of_impl<boost::fusion::non_fusion_tag>'
/usr/include/boost/fusion/iterator/key_of.hpp:20:16: error: declaration of 'struct boost::fusion::extension::key_of_impl<boost::fusion::non_fusion_tag>'

Snippets of relevant code (hopefully enough):
- the first snipped is how I declare the boost::fusion::map
- the second is how I use and where the error is (<--!!!!!!!!)

...
namespace UserCreator
{
  struct objectId;
  struct userId;
  struct userName;

  typedef boost::fusion::map
  <
     boost::fusion::pair< objectId, ObjectId >,
     boost::fusion::pair< userId, int >,
     boost::fusion::pair< userName, std::string >
> UserArgs;
   struct UserCreationArguments : public MOCFunctionParameter, public UserArgs
...

...
ModelObject* UserCreatorFunction::createObject( const MOCFunctionParameter* aMOCFunctionParameter /* = NULL */) const
{
...
  if ( (arguments = dynamic_cast< UserCreator::UserCreationArguments* >(const_cast<MOCFunctionParameter*>(aMOCFunctionParameter))) )
  {
     ObjectId& objectId = boost::fusion::at_key< UserCreator::objectId >(*arguments); <--!!!!!!!!
     int& userId = boost::fusion::at_key< UserCreator::userId >(*arguments);
     std::string& userName = boost::fusion::at_key< UserCreator::userName >(*arguments);
     ...

TIA

-- 
Met vriendelijke groeten,
Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl



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