|
Boost Users : |
From: John Femiani (JOHN.FEMIANI_at_[hidden])
Date: 2007-10-11 03:37:32
I am using g++ (GCC) 3.4.2 (mingw-special) and when I use the namespace
boost::fusion it causes boost range to break.
Consider the toy program 'main.cpp', which is attached and also listed
below:
-----------------------------------------------------------------------
#include <iostream>
using namespace std;
#include <boost/fusion/sequence/container/vector.hpp>
#include <boost/range.hpp>
#include <list>
int main()
{
using namespace boost::fusion;
using namespace boost;
std::list<int> ints;
typedef boost::range_iterator<std::list<int> >::type iterator_t;
for (iterator_t i = begin(ints); i != end(ints); ++i){
cout << * i << endl;
}
return 0;
}
--------------------------------------------------------------------
This program fails to compile with many errors, the first is
C:/MSYS/1.0/include/boost/fusion/sequence/intrinsic/begin.hpp:56: error:
invalid use of undefined type `struct
boost::fusion::extension::begin_impl<boost::fusion::non_fusion_tag>::app
ly<const std::list<int, std::allocator<int> > >'
If I remove 'using namespace boost::fusion' then everything compiles.
This toy program demonstrates an error I got when trying to compile a
function that involved both a fusion::vector and std::list. It was easy
to work around it in my case by explicitly saying boost::fusion::begin
instead of using the namespace, but I suspect that this is still a bug.
Please let me know if I misunderstood the correct way to use fusion or
range.
Thanx,
-- John
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