|
Boost Users : |
From: Chris Weed (chrisweed_at_[hidden])
Date: 2007-01-18 00:32:05
Hi,
I am trying to get the type of the first element in a fusion vector
using mpl::at_c. This seems simple enough.
// Here is the code
#include <boost/fusion/sequence/container/vector.hpp>
#include <boost/mpl/at.hpp>
int main()
{
typedef boost::fusion::vector<int,int> VectorType;
typedef boost::mpl::at_c<VectorType,0>::type value0;
return 0;
}
This won't compile on vc-8.0, and I get the following error message:
...patience...
...found 467 targets...
...updating 2 targets...
msvc.compile.c++ bin\msvc-8.0\debug\example2.obj
example2.cpp
using native typeof
boost\boost/mpl/begin_end.hpp(35) : error C2903: 'apply' : symbol is
neither a class template nor a function template
boost\boost/mpl/aux_/at_impl.hpp(33) : see reference to class
template instantiation 'boost::mpl::begin<Sequence>' being compiled
with
[
Sequence=VectorType
]
boost\boost/mpl/at.hpp(45) : see reference to class template
instantiation 'boost::mpl::at_impl<Tag>::apply<Sequence,N>' being
compiled
with
[
Tag=boost::fusion::fusion_sequence_tag,
Sequence=VectorType,
N=boost::mpl::long_<0>
]
examples\example2.cpp(11) : see reference to class template
instantiation 'boost::mpl::at_c<Sequence,N>' being compiled
with
[
Sequence=VectorType,
N=0
]
boost\boost/mpl/begin_end.hpp(35) : error C2027: use of undefined type
'boost::mpl::begin_impl<boost::fusion::fusion_sequence_tag>'
boost\boost/mpl/begin_end.hpp(35) : error C2059: syntax error : '<'
boost\boost/mpl/begin_end.hpp(35) : error C2039: 'type' : is not a
member of '`global namespace''
boost\boost/mpl/begin_end.hpp(35) : error C2238: unexpected token(s)
preceding ';'
boost\boost/mpl/aux_/at_impl.hpp(33) : error C2039: 'type' : is not a
member of 'boost::mpl::begin<Sequence>'
with
[
Sequence=VectorType
]
boost\boost/mpl/aux_/at_impl.hpp(34) : error C2146: syntax error :
missing ',' before identifier 'type'
boost\boost/mpl/aux_/at_impl.hpp(34) : error C2065: 'type' :
undeclared identifier
boost\boost/mpl/aux_/at_impl.hpp(35) : error C2955:
'boost::mpl::advance' : use of class template requires template
argument list
boost\boost/mpl/advance.hpp(60) : see declaration of
'boost::mpl::advance'
boost\boost/mpl/aux_/at_impl.hpp(35) : error C2039: 'type' : is not a
member of 'boost::mpl::advance'
boost\boost/mpl/advance.hpp(60) : see declaration of
'boost::mpl::advance'
boost\boost/mpl/aux_/at_impl.hpp(35) : error C2146: syntax error :
missing ';' before identifier 'iter_'
boost\boost/mpl/aux_/at_impl.hpp(35) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
boost\boost/mpl/aux_/at_impl.hpp(35) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
boost\boost/mpl/aux_/at_impl.hpp(37) : error C2065: 'iter_' :
undeclared identifier
boost\boost/mpl/aux_/at_impl.hpp(37) : error C2955:
'boost::mpl::deref' : use of class template requires template argument
list
boost\boost/mpl/deref.hpp(35) : see declaration of 'boost::mpl::deref'
boost\boost/mpl/aux_/at_impl.hpp(37) : error C2371:
'boost::mpl::at_impl<Tag>::apply<Sequence,N>::type' : redefinition;
different basic types
with
[
Tag=boost::fusion::fusion_sequence_tag,
Sequence=VectorType,
N=boost::mpl::long_<0>
]
boost\boost/mpl/aux_/at_impl.hpp(35) : see declaration of
'boost::mpl::at_impl<Tag>::apply<Sequence,N>::type'
with
[
Tag=boost::fusion::fusion_sequence_tag,
Sequence=VectorType,
N=boost::mpl::long_<0>
]
call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo -TP /Z7 /Od /Ob0 /W3 /GR /MDd /Zc:forScope
/Zc:wchar_t /wd4675 /EHs @"bin\msvc-8.0\debug\example2.obj.rsp" -c
-Fo"bin\msvc-8.0\debug\example2.obj"
...failed msvc.compile.c++ bin\msvc-8.0\debug\example2.obj...
...skipped <pbin\msvc-8.0\debug>example2.exe for lack of
<pbin\msvc-8.0\debug>example2.obj...
...failed updating 1 target...
...skipped 1 target...
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