Boost logo

Boost Users :

Subject: [Boost-users] boost.fusion compile error using VC 8: error C2039: 'tag_of' : is not a member of 'boost::fusion::traits::detail'
From: Tang Jiangjun (tangjiangjun_at_[hidden])
Date: 2009-06-28 14:33:48


When I compiled the code snippet as follows, there were some errors about
searching tag_of in namespace boost::fusion::traits::detail. But after
reviewing the source code, I found the desired tag_of was actually located
in namespace boost::fusion::detail. Moreover it will be compiled
successfully if adding this full and correct namespace before tag_of in the
file <is_sequence.hpp>.

Here is code snippet:

    typedef fusion::vector< int, string > TPerson;
    TPerson person( 20, "Alan" );
    cout << person << endl;

Here are compile errors:

1>d:\libraries\boost_1_39_0\boost\fusion\support\is_sequence.hpp(59) : error
C2039: 'tag_of' : is not a member of 'boost::fusion::traits::detail'
1> d:\libraries\boost_1_39_0\boost\utility\enable_if.hpp(36) : see
reference to class template instantiation
'boost::fusion::traits::is_sequence<T>' being compiled
1> with
1> [
1> T=TPerson
1> ]
1> d:\samples\boost\fusion\fusion.cpp(28) : see reference to class
template instantiation 'boost::enable_if<Cond,T>' being compiled
1> with
1> [
1> Cond=boost::fusion::traits::is_sequence<TPerson>,
1> T=std::ostream &
1> ]

Here is the origin code in <is_sequence.hpp>:

    namespace traits
    {
        template <typename T>
        struct is_sequence
            : extension::is_sequence_impl<typename
detail::tag_of<T>::type>::
                template apply<T>
        {};
    }

Here is the modification:

    namespace traits
    {
        template <typename T>
        struct is_sequence
            : extension::is_sequence_impl<typename
boost::fusion::detail::tag_of<T>::type>::
                template apply<T>
        {};
    }

I guess this should be a minor bug in boost.fusion.



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