Relative Content

Tag Archive for c++templatesc++17sfinaeincomplete-type

How to invoke template function with maybe incomplete type argument

Template function func<T> is designed to be used any where. It has the same function body for any T. I want to write its body only once. But the function depends on the definition type<T> to work properly, and there’s no definition of type<T> in some context. See the following example(in C++17):