I was wondering if the type of a value template parameter could be deduced or obmitted when writing something similar to this:
enum class MyEnum {A, B}
enum class MyOtherEnum {X, Y}
template <typename T, T value>
struct GenericStruct {};
When using MyGenericStruct
both T
and value
have to be passed, but T
would be deducible from context typename T = decltype(value)
except that value
is not yet defined. template <auto value>
isn't working either.
Is there any way to simply write MyGenericStruct<MyEnum::A>
instead of MyGenericStruct<MyEnum, MyEnum::A>
without usage of macros?