Boost logo

Boost :

From: Hamish Mackenzie (boost_at_[hidden])
Date: 2002-02-18 10:23:26

On Mon, 2002-02-18 at 14:23, Rainer Deyke wrote:
> ----- Original Message -----
> From: "Herb Sutter" <hsutter_at_[hidden]>
> To: "Boost" <boost_at_[hidden]>
> Sent: Monday, February 18, 2002 1:11 AM
> Subject: [boost] Most needed/desired features in C++
> > 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?"
> One thing that bothers me about C++ is that there are effectively two
> very different languages, a runtime language and a compile time
> language. A full resolution of this issue probably requires a total
> redesign of the language, but it might be mitigated by allowing
> elements of the runtime language into the compile time language:

I have been wondering if the mpl gurus could add something like this to
create runtime code using mpl

  class arg_1;
  class arg_2;

  template< typename mpl_code >
  class convert_mpl_to_runtime;

  // Loads of specializations in mpl headers

Then the user could write

  std::vector< int > v;
  convert_mpl_to_runtime< mpl::insert< arg_1, arg_2, arg_3 > >
    ::execute( v, v.begin(), 1 );

Kind of runtime lambda mpl. Wouldn't make learning mpl any easier but it
might make it easier to switch code from compile time to run time and
visa versa.

> template <class A, class B> class is_same {
> if (A == B) {
> enum { result = true; }
> } else {
> enum { result = false; }
> }
> };
> This is not technically necessary, but it would the compile time
> language much easier to learn for those who are already familiar with
> the runtime language.

I think that would help learning a lot. I spent some time playing with
prolog as it is a lot more like C++ templates than the rest of C++ is.


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