$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [mpl] Why no wrapper for pointers as non-type template parameters?
From: Philipp Moeller (philipp.moeller_at_[hidden])
Date: 2012-05-04 16:24:42
I'm a little surprised that the MPL does not offer a wrapper for
pointers as constants. They sometimes come in handy to specify lists to
different callable objects.
Something along the lines of:
template<typename T, T N>
struct ptr_wrap {
static const T value;
typedef ptr_wrap<T, N> type;
typedef T value_type;
};
template<typename T, T N>
typename ptr_wrap<T, N>::value_type const ptr_wrap<T, N>::value = N;
already does the job for me, but it could possibly be enhanced with a
helper to use the correct syntax for pointers to member.
Could this be an addition to the library or is there a better way?
Cheers,
Philipp Moeller