Boost logo

Boost :

Subject: Re: [boost] The Lonely Song of the MPL Maintainer -- or Boost support for antediluvian compiler and the future supprot of C++11
From: Loïc Joly (loic.actarus.joly_at_[hidden])
Date: 2011-08-17 11:47:39


Le 13/08/2011 18:18, Joel falcou a écrit :
> <radical>
> Some are a trivial port like Boost.PP and all the TR1 boost library
> that will just either disappear or forward the C++11 version.
> </radical>

I think this is a really important point. Currently, it is really
difficult to use boost with a C++11-aware compiler, because of the
similarity of names between boost:: and std:: names. I know namespaces
were designed to solve such problems, but except if the user explicitly
qualifies every names, problems do occur (1). If boost just forwarded to
the standard implementation if available, those problems would
disappear. This would also allow a better interoperability between
boost-aware code and C++11-aware code (passing a std::shared_ptr to
boost.serialization, for instance).

(1) Here is an example of a possible problem, this code can (rightly)
fails to compile on a C++11 compiler:

#include <string>
#include <boost/smart_ptr.hpp>
#include <boost/make_shared.hpp>

using namespace boost;

int main()
{
     std::string s = "Hello world!";
     shared_ptr<std::string> ptr = make_shared<std::string>(s);
}

-- 
Loïc

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk