Note: This is a question-with-answer in order to document a technique that others might find useful, and in order to perhaps become aware of others’
In C++14, variable templates make type traits a lot more comfortable to look at. Combine that with C++11 template aliases, and all the cruft disappears:
template
bool is_base_of_v = std::is_base_of::value;
template
using enable_if_t = typename std::enable_if::type;
Usage:
template
enable_if_t, Foo> some_function(B & b, D & d) { /* ... */ }
"Type" aliases of the form _t
are in fact planned as part of the standard library for C++14, see [meta.type.synop].