
On 5 Jun 2016 at 17:53, Rob Stewart wrote:
namespace boost { namespace afio { namespace stl { #if BOOST_AFIO_USING_BOOST_ATOMIC namespace atomic = ::boost; #else namespace atomic = ::std; #endif
#if BOOST_AFIO_USING_BOOST_THREAD namespace thread = ::boost; #else namespace thread = ::std; #endif
#if BOOST_AFIO_USING_BOOST_FILESYSTEM namespace filesystem = ::boost; #else namespace filesystem = ::std; #endif } } }
Now end user code must always write stl::<selector>::<class>. This I think would work well enough.
That also wasn't what he suggested.
Vicente's idea was to import, say, std::thread or boost::thread into a new, common namespace. That is, foo::thread might refer to either of the others, based upon platform support or even an override macro.
I'm sorry, I really don't understand how this is different from the
code referred to above where boost::afio::stl::thread::thread would
be exactly what you say.
If you meant you want to import exclusively and solely the
boost::thread type alone, you could do:
namespace boost { namespace afio { namespace stl { typedef
::boost::thread thread; } } }
Is that what you meant?
If so, that pattern doesn't scale out. It doesn't support templates
under 03, and you rarely need to import just boost::thread, but
rather boost::thread and the other support stuff in the