This is a more formal statement of the same suggestion I've already given in
other threads.
Currently, library developers who need type traits functionality face a
choice: either to use the TypeTraits library, and make their libraries
dependent on MPL, Preprocessor, TypeOf and Utility, or to duplicate its
functionality locally.
Similarly, developers who want to specialize a type trait on a type of
theirs, even a trivial empty struct, need to include the TypeTraits headers
for the traits to be specialized, which brings in MPL and Preprocessor on a
header-level, and makes their module dependent on TypeTraits and its
dependencies listed above.
Local replication, as in Boost.Move, rightly attracts charges of code
duplication, with the associated potential maintenance problems when the
implementations diverge.
These two problems could be avoided if we were to have core type traits
whose interface consisted solely of a member integral constant called
"value", without any other required members or base classes, and which were
only allowed to depend on Config or StaticAssert.
This solves the second problem because it will then be possible for a
developer to specialize a trait, such as is_pod, by using a forward
declaration of the form
template< class T > struct is_pod;
in the appropriate namespace, like boost::core_type_traits, and then adding
his specializations:
template<> struct is_pod< blank >
{
BOOST_STATIC_CONSTANT( bool, value = true );
};
without including ANY additional headers.
If we look at the current implementation of Boost.TypeTraits, for example
is_pointer, we see this:
template< typename T >
struct is_pointer_impl
{
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::detail::is_pointer_helper