[tuple] Explicit member template function instantiation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tuple] Explicit member template function instantiation

Felipe Magno de Almeida
Hi,

I'm having trouble expliciting instantiating the const get
member-function of a tuple.

I defined my tuple like this:

typedef boost::tuple<std::string, std::string> parameter_tuple;

And I'm trying to instantiate like this:

template boost::tuples::access_traits<boost::tuples::element<0,
parameter_tuple::inherited>::type>::const_type
  parameter_tuple::inherited::get<0>() const;

But it gives me the following error in VC7.1.
I cannot understand why it says it has the wrong return value... I've
tried using std::string const& too but didnt worked...

..\..\..\include\mail\type_parameters.hpp(26) : error C2785:
'access_traits<element<N,boost::tuples::cons<HT,TT>>::type>::const_type
boost::tuples::cons<HT,TT>::get(void) const' and
'boost::tuples::access_traits<T>::const_type
boost::tuples::cons<HT,TT>::get(void) const' have different return
types
        with
        [
            HT=std::string,
            TT=boost::tuples::detail::map_tuple_to_cons<std::string,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type
        ]
        and
        [
            T=boost::tuples::cons<std::string,boost::tuples::detail::map_tuple_to_cons<boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type>::stored_head_type,
            HT=std::string,
            TT=boost::tuples::detail::map_tuple_to_cons<std::string,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type
        ]
        ..\..\..\libs\boost\boost\tuple\detail\tuple_basic.hpp(405) :
see declaration of 'boost::tuples::cons<HT,TT>::get'
        with
        [
            HT=std::string,
            TT=boost::tuples::detail::map_tuple_to_cons<std::string,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type
        ]
        ..\..\..\include\mail\type_parameters.hpp(26) : see
declaration of 'boost::tuples::cons<HT,TT>::get'
        with
        [
            HT=std::string,
            TT=boost::tuples::detail::map_tuple_to_cons<std::string,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type
        ]
        ..\..\..\include\mail\multipart.hpp(90) : see reference to
class template instantiation
'mail::multipart_detail::storage_selector_helper<MemoryStorageT,AsyncStorageT>'
being compiled
        ..\..\..\include\mail\memory_storage.hpp(34) : see reference
to class template instantiation 'mail::memory_storage_traits<T>' being
compiled
..\..\..\include\mail\type_parameters.hpp(26) : error C2888:
'boost::tuples::access_traits<T>::const_type
boost::tuples::cons<HT,TT>::get(void) const' : symbol cannot be
defined within namespace 'mail'
        with
        [
            T=boost::tuples::cons<std::string,boost::tuples::detail::map_tuple_to_cons<boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type>::stored_head_type,
            HT=std::string,
            TT=boost::tuples::detail::map_tuple_to_cons<std::string,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type
        ]
..\..\..\include\mail\type_parameters.hpp(26) : error C3190:
'boost::tuples::access_traits<T>::const_type
boost::tuples::cons<HT,TT>::get(void) const' with the provided
template arguments is not the explicit instantiation of any member
function of '<Unknown>'
        with
        [
            T=boost::tuples::cons<std::string,boost::tuples::detail::map_tuple_to_cons<boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type>::stored_head_type,
            HT=std::string,
            TT=boost::tuples::detail::map_tuple_to_cons<std::string,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::type
        ]

    call "C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\bin\vcvars32.bat"  >nul
cl /Zm800 -nologo -TP  /Z7 /Od /Ob0 /W4 /WX /GR /MDd /Zc:forScope
/Zc:wchar_t /Wp64 /GB /wd4675 /EHs /wd4100 /wd4127 /wd4311 /wd4312
/wd4510 /wd4511 /wd4512 /wd4610
@"..\..\..\bin\projects\mail\test\multipart_basic.test\msvc-7.1\debug\multipart_basic.obj.rsp"
-c -Fo"..\..\..\bin\projects\mail\test\multipart_basic.test\msvc-7.1\debug\multipart_basic.obj"


Any help would be appreciated
Thanks in advance,
--
Felipe Magno de Almeida

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost