Boost logo

Boost :

From: Hamish Mackenzie (boost_at_[hidden])
Date: 2002-02-18 09:46:01


On Mon, 2002-02-18 at 08:11, Herb Sutter wrote:
> Hi folks,
>
> Pardon if this has already been discussed on the list, but I'd like your
> feedback on this question: "What are the most needed or desired features in
> C++ for modern library writing in general and Boost in particular?"
>
> Two usual suspects:
> - typedef templates
> - typeof (with gcc semantics?)
>
> What else should be on the list? For example, is there language support that
> would assist type traits?

If I had to put them in order....

1) typedef templates - Its just soooo painful without them
2) typeof
I think Peter Dimov is right it should return reference types.

3) reflection - at compile time

That is to say the reflection information should come in the form of
tuples and typelists not std::vectors.

4) ability to attach compile time meta data easily

In particular it would be nice for functions to specify their guarantee
(none, basic, strong or nothrow). Algorithms could then select the best
implementation based on this information.
  int f() garantee< strong > {}

Obviously a template function would need to be able to supply an
expression to define its guarantee.
  template< typename T >
  int f( T & x ) guarantee< meta_get< T::g(), garantee > >
  {
    return x.g();
  }

Another nice possibility would be a convenient way for callers to
request a minimum guarantee or assert what the guarantee should be
  f() meta_assert< guarantee >= strong >;

Finaly it would be nice to be able to attach this to all calls in a
block of code. For instance...
  template< typename T >
  void f( T & x ) guarantee< strong >
  {
    {
      meta_assert< guarantee >= basic >;
      T temp( x );
      temp.g();
    }

    meta_assert< guarantee == nothrow >;
    swap( x, temp );
  }

5) some kind mutable temporaries to allow return values to be used as
non const references.
  use_it( mutable f() );
Instead of
  T temp( f() );
  use_it( temp );

I have made a couple of wacky suggestions which I would like to see
added or shot down in flames.

6) Prolog-ish support for recursive templates
  recursive< tuple_traits, int, float, bool >
and
  recursive< tuple_traits, int, float, bool | Tail >
Where tuple_traits must contain a typdef for empty list and dot function
(a template class taking two arguments)

http://groups.yahoo.com/group/boost/message/20721

7) Support for using constants as types
http://groups.yahoo.com/group/boost/message/25392


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