1
MSVCのコンパイラのバグの可能性
次のコードは、gccとclang(および他の多くのC ++ 11コンパイラ)でコンパイルされます。 #include <stdint.h> typedef int datatype; template <typename T> struct to_datatype {}; template <> struct to_datatype<int16_t> { static constexpr datatype value = 1; }; template <typename T> class data { public: data(datatype dt = to_datatype<T>::value) {} }; int main() { data<char> d{to_datatype<int16_t>::value}; } (ほぼ)最新のMSVCでコンパイルする場合 > cl .\test.cpp /std:c++latest …
13
c++
c++11
visual-c++