Boost logo

Boost Users :

Subject: [Boost-users] previously working boost code breaks with c++0x
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2010-07-07 13:15:56


Hello,

The following code, which compiles just fine with g++ 4.4 without the --std=c++0x flag,
gives an error with that flag:

#include <string>

#include <boost/tuple/tuple.hpp>

#include <boost/algorithm/string.hpp>

using boost::make_tuple;

void f(int i, const std::string& s)
{
    boost::tuple<int, std::string> t;
    t = make_tuple(i, s);
}

test.cpp: In function ‘void f(int, const std::string&)’:
test.cpp:12: error: no match for ‘operator=’ in ‘t = std::make_tuple(_Elements&& ...) [with _Elements = int&, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&](((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)((const std::string*)s)))’

Note that any one of the following makes the code compile:

1) Removing the --std=c++0x flag
2) Removing the <boost/algorithm/string.hpp> include
3) Removing the using boost::make_tuple declaration and explciitly qualifying boost::make_tuple in f().

What is going on?

Thanks,
Nate.
                                               
_________________________________________________________________
Learn more ways to connect with your buddies now
http://go.microsoft.com/?linkid=9734388



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