C++相談室 part89
■ このスレッドは過去ログ倉庫に格納されています
0683デフォルトの名無しさん
2011/07/01(金) 01:16:54.41> メンバ変数にvector保持する時、ポインタにして前方宣言すれば#include <vector>をヘッダに書かなくて住みますよね。
ダメ。ユーザープログラムが namespace std に宣言を行った場合、未定義動作になる。
17.4.3.1 [lib.reserved.names] p1 (C++2003)
"It is undefined for a C++ program to add declarations or definitions to namespace
std or namespaces within namespace std unless otherwise specified."
17.6.4.2.1 [namespace.std] p1 (N3290)
"The behavior of a C++ program is undefined if it adds declarations or definitions to
namespace std or to a namespace within namespace std unless otherwise specified."
■ このスレッドは過去ログ倉庫に格納されています