template <class T>
static constexpr int value = someFunc<T>();
template<template<class> int>
struct Smthg
{
...
};
int main()
{
Smthg<value> t;
}
struct holder
{
...
template <template<class> auto& Func>
constexpr auto visit() { ... }
...
};
template <class T>
void printType() { ... }
template <class T>
static constexpr size_t size_of = []() {
return sizeof(T);
};
int main()
{
auto t = returns_holder();
t.visit<printType>();
std::cout << t << t.visit<sizeo_of>() << std::endl;
}