以下は有効な c++ ではないようです ( -std=c++2a
)。var
テンプレート パラメータに基づいてのストレージ クラスを変更したいb
:
#include <type_traits>
template <bool b>
void f() {
typename std::conditional<b, static int, int>::type var;
}
以下は有効な c++ ではないようです ( -std=c++2a
)。var
テンプレート パラメータに基づいてのストレージ クラスを変更したいb
:
#include <type_traits>
template <bool b>
void f() {
typename std::conditional<b, static int, int>::type var;
}