Here is what I want to do:
template <typename T> void f(DisableDeduction<T> obj) {std::cout << obj;}
Here is how I am currently achieving this:
template <typename T> struct DisableDeduction_Internal {using type = T;}; template <typename T> using DisableDeduction = typename DisableDeduction_Internal<T>::type;
It works fine (as described), but it introduces one additional helper type.
But can I achieve the same result without additional types?
c ++ templates
Holyblackcat
source share