The following code will cause compile errors in g++4.4:
// File test.cpp
namespace A
{
#include <iostream>
}
int main()
{
return 0;
}
I have this requirement because some third party library comes without namespace protected, and if I directly include these headers, my namespace is polluted.
As a result, I tried to create namespaces for those libraries, but if the library includes some "std headers" the above approach will fail.
I believe 17.4.2.1 [lib.using.headers] forbids including standard library headers in a namespace :
I don’t think there is anything you can do besides filing a request to the library author.