Hello,
I'm choking on a piece of C++ I have no idea about how to
translate to D.
template <typename T,
typename std::enable_if< std::is_const<T>::value == true,
void>::type* = nullptr>
constexpr const char *modifier() const {
return "[in] ";
}
template <typename T,
typename std::enable_if< std::is_reference<T>::value ==
true, void>::type* = nullptr>
constexpr const char *modifier() const {
return "[out] ";
}
my attempt at it is like this:
template modifier(T) {
static if (is (T==const)) {
const char* modifier = "[in] ";
} else static if (/* T is a reference ?*/) { // [*]
const char* modifier = "[out] ";
}
}
but even if I could e.g. say something like
is(T == ref R, R),
auto a = modifier!(ref T);
wouldn't work.