[fusion] Weird compiler error
Hi there, I know the subject looks suspicious. Usually all compiler
errors are weird when you do metaprogramming. Anyway, this example is
a bit different. I'm just trying to compile a small example taking
from the documentation.
#include
Christian Henning wrote:
Hi there, I know the subject looks suspicious. Usually all compiler errors are weird when you do metaprogramming. Anyway, this example is a bit different. I'm just trying to compile a small example taking from the documentation.
Compiles fine for me. You have to take care about the using namespace and ambiguity. pair, for example, is available in std and fusion. Of course, you already knew that ;) Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Yep, I knew that, even when my code wasn't showing it. ;-) It still
doesn't compile an my end and I have no idea why. I have removed all
using namespace directives and still no luck.
#include
Christian Henning wrote:
Yep, I knew that, even when my code wasn't showing it. ;-) It still doesn't compile an my end and I have no idea why. I have removed all using namespace directives and still no luck.
#include
int _tmain(int argc, _TCHAR* argv[]) { typedef boost::fusion::map< boost::fusion::pair
, boost::fusion::pair , boost::fusion::pair > mymap; BOOST_MPL_ASSERT(( boost::is_same< boost::fusion::result_of::at_key
::type, char&>)); return 0; }
What compiler are you using?
I use VC7.1 and VC8.0 among others. Looks like you are experiencing a preprocessor problem, but I'm not sure. Try Boost static assert instead. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Thanks for the support. Even BOOST_STATIC_ASSERT isn't working.
#include
Christian Henning wrote:
Yep, I knew that, even when my code wasn't showing it. ;-) It still doesn't compile an my end and I have no idea why. I have removed all using namespace directives and still no luck.
#include
int _tmain(int argc, _TCHAR* argv[]) { typedef boost::fusion::map< boost::fusion::pair
, boost::fusion::pair , boost::fusion::pair > mymap; BOOST_MPL_ASSERT(( boost::is_same< boost::fusion::result_of::at_key
::type, char&>)); return 0; }
What compiler are you using?
I use VC7.1 and VC8.0 among others. Looks like you are experiencing a preprocessor problem, but I'm not sure. Try Boost static assert instead.
Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Christian Henning wrote:
Thanks for the support. Even BOOST_STATIC_ASSERT isn't working.
#include
#include int _tmain(int argc, _TCHAR* argv[]) { typedef boost::fusion::map< boost::fusion::pair
, boost::fusion::pair , boost::fusion::pair > mymap; BOOST_STATIC_ASSERT(( boost::is_same< char, char >));
return 0; }
The error are now:
c:\cybermdx\Test Programs\temove\remove\remove.cpp(16) : error C2059: syntax error : ')' c:\cybermdx\Test Programs\temove\remove\remove.cpp(16) : error C2059: syntax error : ')' c:\cybermdx\Test Programs\temove\remove\remove.cpp(19) : error C2143: syntax error : missing ';' before '}' c:\cybermdx\Test Programs\temove\remove\remove.cpp(20) : error C2143: syntax error : missing ';' before '}' c:\cybermdx\Test Programs\temove\remove\remove.cpp(20) : fatal error C1004: unexpected end of file found
On 3/20/07, Joel de Guzman
wrote: Christian Henning wrote:
Yep, I knew that, even when my code wasn't showing it. ;-) It still doesn't compile an my end and I have no idea why. I have removed all using namespace directives and still no luck.
#include
int _tmain(int argc, _TCHAR* argv[]) { typedef boost::fusion::map< boost::fusion::pair
, boost::fusion::pair , boost::fusion::pair > mymap; BOOST_MPL_ASSERT(( boost::is_same< boost::fusion::result_of::at_key
::type, char&>)); return 0; }
What compiler are you using? I use VC7.1 and VC8.0 among others. Looks like you are experiencing a preprocessor problem, but I'm not sure. Try Boost static assert instead.
Oh. Definitely looks like a PP problem. Unfortunately I can't help you. I can't recreate the problem here. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Christian Henning wrote:
Thanks for the support. Even BOOST_STATIC_ASSERT isn't working.
#include
#include int _tmain(int argc, _TCHAR* argv[]) { typedef boost::fusion::map< boost::fusion::pair
, boost::fusion::pair , boost::fusion::pair > mymap; BOOST_STATIC_ASSERT(( boost::is_same< char, char >));
return 0; }
'::value' seems missing. Well, IIRC, Boost1.34 MPL_ASSERT has a problem around __LINE__ under IDE. That was fixed with CVS Head. But I'm not sure. -- Shunsuke Sogame
When adding ::value to is_same<...> it works. Thanks Shunsuke for the tip.
#include
Christian Henning wrote:
Thanks for the support. Even BOOST_STATIC_ASSERT isn't working.
#include
#include int _tmain(int argc, _TCHAR* argv[]) { typedef boost::fusion::map< boost::fusion::pair
, boost::fusion::pair , boost::fusion::pair > mymap; BOOST_STATIC_ASSERT(( boost::is_same< char, char >));
return 0; }
'::value' seems missing. Well, IIRC, Boost1.34 MPL_ASSERT has a problem around __LINE__ under IDE. That was fixed with CVS Head. But I'm not sure.
-- Shunsuke Sogame
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Christian Henning wrote:
#include
using namespace std; using namespace boost;
int _tmain(int argc, _TCHAR* argv[]) { typedef fusion::map< fusion::pair
, fusion::pair , fusion::pair > mymap; BOOST_STATIC_ASSERT((boost::is_same< fusion::result_of::at_key ::type, char&>::value)); return 0; }
I have downloaded the CVS Head but here I'm getting an Internal Compiler Error. Is that a known issue?
Seems to compile fine. I don't know why you cannot. How about Rebuild. -- Shunsuke Sogame
participants (3)
-
Christian Henning
-
Joel de Guzman
-
shunsuke