
On June 5, 2016 3:47:42 AM EDT, Niall Douglas
On 4 Jun 2016 at 21:28, Rob Stewart wrote:
Edward, you've missed that Vicente doesn't see that importing either a Boost or a Standard Library solution, into a common namespace requires anything more of the user.
The user would always use the new, common namespace name for something, regardless of its original namespace. For example, foo::x is the common name, but x may have been introduced into the foo namespace, by a using directive, from the boost or the std namespace.
Do you mean an ultra-simplified
It was Vicente's idea.
form of what boost-lite does like this:
namespace boost { namespace afio { #if BOOST_AFIO_USING_BOOST_THREAD namespace stl11 = ::boost; #else namespace stl11 = ::std; #endif
#if BOOST_AFIO_USING_BOOST_FILESYSTEM namespace stl1z = ::boost; #else namespace stl1z = ::std; #endif } }
No, that wasn't what he was suggesting.
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.
I'll reiterate that boost-lite requires less typing on the end user and is much safer and less error prone to use than the above scheme.
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. ___ Rob (Sent from my portable computation engine)