$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-02-25 11:52:03
FWIW in
http://groups.yahoo.com/group/boost/message/21721
I propose that
"The result of a compile-time function is obtained using function<A1, ...,
An>::type.
For convenience, some compile-time functions return compile-time values, as
well, obtained via function<A1, ..., An>::value."
IOW is_const would look like:
template<class T> struct is_const
{
static const bool value = false;
typedef ct_value<bool, false> type;
};
template<> struct is_const<T const>
{
static const bool value = true;
typedef ct_value<bool, true> type;
};
where ct_value is
template<class T, T v> struct ct_value
{
static const T value = v;
};
"The metaprogramming library operates on types only. Compile-time values are
wrapped in ct_value<Type, Value>.
(Rationale: practice shows that attempting to cover compile-time values as
well results in excessive duplication. ct_value<> is chosen to avoid having
separate bool_t, int_t, uint_t, size_t_t and so on.)"