c++ template parameter type inference
UPDATE c++17 introduced “P0127R2 Declaring non-type template parameters with auto“, allowing to declare a non-type template parameter(s) with auto as a placeholder for the actual type: template <auto P> struct Ptr {}; That is, P is a non-type template parameter. Its type can be inferred with decltype(P). auto in a template parameter list is subject … Read more