【C++】template 統合スレ -- Part6
at TECH
938:636
05/09/15 13:09:16
>>637
identifier "f2" is undefined
detected during instantiation of "void f1(T) [with T=int]"
というエラーです。strict mode のみのようです。
ちなみに、ユーザ定義型の場合は期待通りにコンパイルできました。
template <class T>
void f1(T t)
{
f2(t);
}
struct a{};
void f2(a) {}
namespace adl
{
struct a{};
void f2(a) {}
}
int main()
{
f1(a());
f1(adl::a());
}
このコードはコンパイル成功。
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5377日前に更新/262 KB
担当:undef