Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-06-10 22:34:48


I guess I'm not familiar enough with the usage to be able to evaluate the
options here. What constructability guarantees are you referring to? What is
the upshot of having a non-assignable value_type? What is the impact on real
code?

-Dave
----- Original Message -----
From: "John Maddock" <John_Maddock_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, June 10, 2000 7:41 AM
Subject: [boost] call_traits.hpp

> Dave,
>
> >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
> options:
>
> 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
> value_type[N];
> typedef T (&reference)[N]; // hh was typedef T*& reference;
> typedef const T (&const_reference)[N]; // hh was typedef const T*&
> const_reference;
> typedef value_type param_type; // hh was typedef T* param_type;
> };
>
> Option 2: meets constructability guarentees but value_type is not
> assignable:
>
> template <typename T, std::size_t N>
> struct call_traits<T [N]>
> {
> private:
> typedef T array_type[N];
> public:
> typedef array_type& value_type;
> typedef value_type reference;
> typedef const array_type& const_reference;
> typedef value_type param_type;
> };
>
> Thoughts?
>
> - John.
>
>
> ------------------------------------------------------------------------
> Take your development to new heights. Work with clients like Dell and
> pcOrder. Submit your resume to jobs_at_liaison.com. Visit us at
> http://click.egroups.com/1/4358/3/_/9351/_/960637282/
> ------------------------------------------------------------------------
>
>


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