I have the following two structs:
template<typename T>
struct one { /* ... */ };
template<template<typename...> typename T>
struct two { /* ... */ };
When I have example instantiated/uninstantiated templates like this:
template<typename T>
struct sample_templated { /* ... */ };
using instantiated = sample_templated<double>;
then I can do
one<instantiated>{};
two<sample_templated>{};
just fine. I would like to merge the definition of one
and two
such that they have the same name, though, as this would allow recursion.
I tried having a default definition like
template<typename...>
struct types_match_impl;
and having the two original structs be partial specializations of this, but this is incompatible with two
.
What is the solution here?