namespace detail
{
template <typename... StaticChecks>
struct static_combined_check_impl;
template <typename StaticCheck, typename... Rest>
struct static_combined_check_impl<StaticCheck, Rest...>
{
using type = StaticCheck;
};
template <typename... Rest>
struct static_combined_check_impl<consistent_t, Rest...>
{
using type = typename static_combined_check_impl<Rest...>::type;
};
template <>
struct static_combined_check_impl<>
{
using type = consistent_t;
};
} // namespace detail
using combined = detail::static_combined_check_impl<consistent_t, inconsistent_t>::type;
For a given code (e.g. see the type 'combined' above), I can figure out which templates are instantiated and called; but I want some help from the compiler. There must be a way to trigger an error only when a particular template is instantiated, allowing for better debugging a meta program. But how?
By the way, consistent_t and inconsistent_t are just plain empty structs.