std::tuple vs boost::tuple clashes in C++0x

Just wanted to post a general comment, to boost library developers. There are lots of names which in C++0x occur in both boost:: and std::. The big ones are tuple, make_tuple and array, but there are others (for example locking functions from thread). I am fixing bugs which occur in the C++0x mode of clang/libc++, and the vast majority of these bugs are tests which write things like: ... using namespace boost; using namespace std; .... tuple<int,int> t; Even if you don't include <tuple>, a definition of tuple gets pulled in by <utility>, which almost everything includes. Please don't write "using namespace std; using namespace boost;" in boost tests. You probably shouldn't write it at all :) Chris

On Tue, Apr 5, 2011 at 5:16 PM, Christopher Jefferson <chris@bubblescope.net> wrote:
There are lots of names which in C++0x occur in both boost:: and std::. The big ones are tuple, make_tuple and array, but there are others (for example locking functions from thread).
Just wondering, shouldn't boost::array just map to std::array if the latter is available? -- Olaf

On 5 Apr 2011, at 16:29, Olaf van der Spek wrote:
On Tue, Apr 5, 2011 at 5:16 PM, Christopher Jefferson <chris@bubblescope.net> wrote:
There are lots of names which in C++0x occur in both boost:: and std::. The big ones are tuple, make_tuple and array, but there are others (for example locking functions from thread).
Just wondering, shouldn't boost::array just map to std::array if the latter is available?
The two aren't entirely compatible, although they are close (boost::array has assign, static_size). Probably the major thing is that boost has a much more relaxed operator=. Also "map to" is tricky to do in C++ effectively. Chris

On 05/04/2011 17:16, Christopher Jefferson wrote:
using namespace boost; using namespace std; .... tuple<int,int> t;
Even if you don't include<tuple>, a definition of tuple gets pulled in by<utility>, which almost everything includes.
Please don't write "using namespace std; using namespace boost;" in boost tests. You probably shouldn't write it at all :)
Flag a bug to each affected library?
participants (3)
-
Christopher Jefferson
-
Mathias Gaunard
-
Olaf van der Spek