Is it possible to declare a new type (an empty struct , or a struct without an implementation) on the fly?
E.g.
constexpr auto make_new_type() -> ???;
using A = decltype(make_new_type());
using B = decltype(make_new_type());
using C = decltype(make_new_type());
static_assert(!std::is_same<A, B>::value, "");
static_assert(!std::is_same<B, C>::value, "");
static_assert(!std::is_same<A, C>::value, "");
A "manual" solution is
template <class> struct Tag;
using A = Tag<struct TagA>;
using B = Tag<struct TagB>;
using C = Tag<struct TagC>;
or even
struct A;
struct B;
struct C;
but for templating / meta some magic make_new_type()
function would be nice.
Can something like that be possible now that stateful metaprogramming is ill-formed?