
On Wed, Feb 16, 2011 at 12:49 PM, Mathias Gaunard <mathias.gaunard@ens-lyon.org> wrote:
On 16/02/2011 13:52, Christopher Jefferson wrote:
[snip]
The question is then if forward declarations of types in std:: are allowed. From 17.6.3.2.1p1 in the current C++0x draft (there is identical text in the c++03 standard):
"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."
While people could read this in various ways, I would say it forbids these kinds of games, although they might work for particular standard libraries.
The standard also gives the reference of what the declarations of the classes of the standard library must be, and all those declarations are in namespace std.
Isn't the standard library allowed to add template parameters with defaults? template <typename T, typename Allocator, typename _InternalParameter = int> struct vector; -- Felipe Magno de Almeida