【C++】template 統合スレ -- Part6at TECH
【C++】template 統合スレ -- Part6 - 暇つぶし2ch938: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