Daniel Spangenberg wrote:
> template <int Precision, int Range = -1>
> class selected_real;

> template <int Range>
> class selected_int;

>  typedef selected_int<9> MyInt;

Those class templates may be of use for some people.
However, until we get typedef templates into the C++
core language, there appears to be no way to defer
the implementation of the type to, say, a plain "int".

This can be fixed by making the selected_XXX classes
template metafunctions that happen to return the correct
type.  Usage:   typedef selected<int>(9)::type MyInt  .

Compare that with boost/integer.hpp where we have
 uint_t<N>::least  and  uint_t<N>::fast  .

Of course, if you compile on a platform that can't
fulfill your precision/range desires, you should get a
compile-time error.

namespace boost::numeric is your friend.

Jens Maurer
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to