变量模板类型

Variable template type

只是想确认模板变量的类型可以独立于模板。这由 g++ 编译:

template<class T> 
constexpr long MAX_AS_LONG = static_cast<long>(std::numeric_limits<T>::max());

是否符合标准?

(在互联网上的所有示例中,模板变量的类型都是 T 本身)。

不要求模板变量的类型因模板参数而异。

一个常见的例子是 std::is_same_v<T,U>,它始终是 bool