Boost logo

Boost :

Subject: Re: [boost] Cxx dual library
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2016-06-05 03:47:42

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.
> In the end, the user always includes the foo header and uses the foo
> name. There are no macros in the user's code. Both solutions select one
> implementation or the other. Yours refers to the namespace of the
> selected implementation with a macro, while his just uses namespace foo.

Do you mean an ultra-simplified form of what boost-lite does like

namespace boost { namespace afio {
  namespace stl11 = ::boost;
  namespace stl11 = ::std;

  namespace stl1z = ::boost;
  namespace stl1z = ::std;
} }

This works, but it's quite ungranular e.g. how do you mash up
Boost.Thread with Std.Atomic? You could enable this at the cost of
extra typing imposed on the end user like this:

namespace boost { namespace afio { namespace stl {
  namespace atomic = ::boost;
  namespace atomic = ::std;

  namespace thread = ::boost;
  namespace thread = ::std;

  namespace filesystem = ::boost;
  namespace filesystem = ::std;
} } }

Now end user code must always write stl::<selector>::<class>. This I
think would work well enough.

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.
Still, the above works.


ned Productions Limited Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at