Boost logo

Boost :

From: jaakko.jarvi_at_[hidden]
Date: 2001-09-07 07:30:53


> which namespaces tuple and cons must be located in. I'm hoping that
> Jaako
> > will do the analyis, and will either show that my concerns are
> without
> > foundation or will propose a solution that takes them into
account.

I created another branch 'tuples_subnamespace' where tuples are in
tuples subnamespace. So all names are in boost::tuples, and
implementation details in boost::tuples::detail.

The following names are lifted to boost as follows:

namespace boost {
  using tuples::tuple;
  using tuples::make_tuple;
  using tuples::tie;
  using tuples::get;
}

So basic usage of tuples doesn't change, the more special stuff
however requires a namespace qualifier. Such names are:

ignore, cons, null_type, element, length, access_traits
set_open, set_close, set_delimiter.

Not that the introduction of the subnamespace allows nicer names:
tuple_element<N, T>::type is now tuples::element<N, T>::type
tuple_length<N, T>::value is now tuples::length<N, T>::value
tuple_access_traits<T>::xxx is now tuples::access_traits<T>::xxx

Further, note that all functions, except make_tuple and tie take
tuples or cons lists as arguments, so they can be found with koenig
lookup. get calls have an explicitly qualified template argument,
preventing koening lookup, and thus the using declaration.

Is this a satisfactory solution? (Dave?)
 
There is one glitch. MSVC++ 6.0 has problems with finding the get
functions (the explicit qualification of the template argument messes
the search up). So with MSVC++ all get calls must be qualified. E.g.
tuples::get<N>(a); etc.

Jaakko

PS. The test files have been changed as well, basically the same tests
should work but while at it, I added some more tests to
tuple_test_bench.hpp


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