[Assign][GIL] Boost Assign and GIL incompatibility in gcc 4.3.2

The following source code compiles under clang 3.1, but fails under gcc 4.3.2 with boost version 1.46. It doesn't look like there are updates to either library in the boost news list since then. #include <vector> #include <boost/assign/std/vector.hpp> // for 'operator+=()' #include <boost/gil/gil_all.hpp> int main(int argc, char** argv){ using namespace boost::assign; std::vector<int> values; values += 1, 2, 3, 4; typedef boost::gil::rgb8_pixel_t pt; std::vector<pt> pixValues; pixValues += pt(1,2,3),pt(2,3,4); } ------------------------------------- Compiler versions: FAILED: gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291] Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SUCCEEDED: Apple clang version 3.1 (tags/Apple/clang-318.0.54) (based on LLVM 3.1svn) Target: x86_64-apple-darwin11.3.0 Thread model: posix Cheers! Andrew Hundt

On Thu, Mar 29, 2012 at 01:07:09PM -0400, Andrew Hundt wrote:
The following source code compiles under clang 3.1, but fails under gcc 4.3.2 with boost version 1.46. It doesn't look like there are updates to either library in the boost news list since then.
[snip]
Compiler versions:
FAILED: gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291] Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Your message seems to be missing any description as to what kind of failure you're experiencing. Is it a compiler failure? Linker failure? Run-time failure? The compiler output tends to help, and also consider filing a bug on our Trac over at http://svn.boost.org/trac/boost
SUCCEEDED: Apple clang version 3.1 (tags/Apple/clang-318.0.54) (based on LLVM 3.1svn) Target: x86_64-apple-darwin11.3.0 Thread model: posix
-- Lars Viklund | zao@acc.umu.se

Whoops! I had the compiler output there to copy in, I just forgot it. I'll also try to add it to trac shortly. ahundt@linux-lmky:~/sandbox> make Scanning dependencies of target boostAssign [100%] Building CXX object CMakeFiles/boostAssign.dir/boostAssign.cpp.o /usr/local/include/boost-1_46/boost/mpl/push_back_fwd.hpp: In function ‘boost::assign::list_inserter<boost::assign_detail::call_push_back<std::vector<_Tp, _Alloc> >, V> boost::assign::operator+=(std::vector<_Tp, _Alloc>&, V2) [with V = boost::gil::pixel<unsigned char, boost::gil::layout<boost::mpl::vector3<boost::gil::red_t, boost::gil::green_t, boost::gil::blue_t>, boost::mpl::range_c<int, 0, 3> >
, A = std::allocator<boost::gil::pixel<unsigned char, boost::gil::layout<boost::mpl::vector3<boost::gil::red_t, boost::gil::green_t, boost::gil::blue_t>, boost::mpl::range_c<int, 0, 3> >
, V2 = boost::gil::pixel<unsigned char, boost::gil::layout<boost::mpl::vector3<boost::gil::red_t, boost::gil::green_t, boost::gil::blue_t>, boost::mpl::range_c<int, 0, 3> > ]’: /home/ahundt/sandbox/boostAssign.cpp:12: instantiated from here /usr/local/include/boost-1_46/boost/mpl/push_back_fwd.hpp:20: error: ‘template<class Sequence, class T> struct boost::mpl::push_back’ is not a function, /usr/local/include/boost-1_46/boost/assign/list_inserter.hpp:348: error: conflict with ‘template<class C> boost::assign::list_inserter<boost::assign_detail::call_push_back<C>, typename C::value_type> boost::assign::push_back(C&)’ /usr/local/include/boost-1_46/boost/assign/std/vector.hpp:31: error: in call to ‘push_back’ make[2]: *** [CMakeFiles/boostAssign.dir/boostAssign.cpp.o] Error 1 make[1]: *** [CMakeFiles/boostAssign.dir/all] Error 2 make: *** [all] Error 2
Cheers! Andrew Hundt On Thu, Mar 29, 2012 at 1:21 PM, Lars Viklund <zao@acc.umu.se> wrote:
On Thu, Mar 29, 2012 at 01:07:09PM -0400, Andrew Hundt wrote:
The following source code compiles under clang 3.1, but fails under gcc 4.3.2 with boost version 1.46. It doesn't look like there are updates to either library in the boost news list since then.
[snip]
Compiler versions:
FAILED: gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291] Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Your message seems to be missing any description as to what kind of failure you're experiencing.
Is it a compiler failure? Linker failure? Run-time failure?
The compiler output tends to help, and also consider filing a bug on our Trac over at http://svn.boost.org/trac/boost
SUCCEEDED: Apple clang version 3.1 (tags/Apple/clang-318.0.54) (based on LLVM 3.1svn) Target: x86_64-apple-darwin11.3.0 Thread model: posix
-- Lars Viklund | zao@acc.umu.se
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Andrew Hundt wrote:
The following source code compiles under clang 3.1, but fails under gcc 4.3.2 with boost version 1.46. It doesn't look like there are updates to either library in the boost news list since then.
#include <vector> #include <boost/assign/std/vector.hpp> // for 'operator+=()' #include <boost/gil/gil_all.hpp>
int main(int argc, char** argv){ using namespace boost::assign; std::vector<int> values; values += 1, 2, 3, 4;
typedef boost::gil::rgb8_pixel_t pt; std::vector<pt> pixValues; pixValues += pt(1,2,3),pt(2,3,4); }
To solve this problem, change Line 31 of boost/assign/std/vector.hpp from return push_back( c )( v ); to return boost::assign::push_back( c )( v ); Regards, Michel
participants (3)
-
Andrew Hundt
-
Lars Viklund
-
Michel Morin