Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-06-10 06:41:23


>Can someone explain the existence of the following in call_traits.hpp, and
>how such code came to be accepted into a release library?

Good question, doesn't look good does it? Looks like we forgot to finish
this - in fact looking closer it's not clear how the array specialisation
should look (and most current compilers don't actually need the array
specialisation anyway), the most recent version (of several) was suggested
by Howard, but doesn't meet the constructability guarantees. Here are the

Option 1: doesn't meet constructability guarentees, but ensures that
value_type is assignable:

template <typename T, std::size_t N>
struct call_traits<T [N]>
   typedef T* const value_type; // hh was typedef T
   typedef T (&reference)[N]; // hh was typedef T*& reference;
   typedef const T (&const_reference)[N]; // hh was typedef const T*&
   typedef value_type param_type; // hh was typedef T* param_type;

Option 2: meets constructability guarentees but value_type is not

template <typename T, std::size_t N>
struct call_traits<T [N]>
   typedef T array_type[N];
   typedef array_type& value_type;
   typedef value_type reference;
   typedef const array_type& const_reference;
   typedef value_type param_type;


- John.

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