Boost logo

Boost :

From: Markus Werle (numerical.simulation_at_[hidden])
Date: 2008-03-15 07:34:55


Hi!

First of all: This is a very nice example.
Fantastic idea to introduce index information stored
in the terminals at this place in the docs - perfect.

If you define arg as

template<int I> struct arg {};

and change the code accordingly the reader is not in need
to know anything about mpl::int_ and IMHO the code

  template <int I>
  double operator ()(proto::tag::terminal, arg<I>) const
  {
    return d[ I - 1 ];
  }

is easier to read than

  template<typename I>
  double operator ()(proto::tag::terminal, arg<I>) const
  {
     return d[ I() - 1 ];
  }
  

Note that this should be written for beginners like me, so
one catches the idea immediately without taking the extra path
to mpl here.

Markus


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