茂加部珈琲店

主にtech関連のメモ置き場です

2017-12-17から1日間の記事一覧

メンバ関数テンプレートでC2783が出る場合

c++

小ネタなのですが VC++(VS2017 15.5.2)で以下のコードはコンパイルに失敗します。 clangとgccでは通ります。 #include <type_traits> struct Foo { template <class U = int, class = std::enable_if_t<std::is_same_v<U,int>>> void f(); }; //template <class U, class> // <- Ok. template <class, class> // <- C2783: could not deduce template argument f…</class,></class></class></type_traits>