E
er
hi,
here's why i'm trying to do:
header1.hpp
namespace{ struct A{};}
struct B1{ A a; };
header2.hpp
namespace{ struct A{};}
struct B2{ A a; };
*.cpp
#include <libs/testing_namespace/header1.hpp>
#include <libs/testing_namespace/header2.hpp>
header2.hpp|5|error: redefinition of ‘struct<unnamed>::A’|
i should expect that because the translation unit includes both
header1 and header 2. so then how can i automatically generate unique
namespaces, one for each of header1 and header2?
thanks.
here's why i'm trying to do:
header1.hpp
namespace{ struct A{};}
struct B1{ A a; };
header2.hpp
namespace{ struct A{};}
struct B2{ A a; };
*.cpp
#include <libs/testing_namespace/header1.hpp>
#include <libs/testing_namespace/header2.hpp>
header2.hpp|5|error: redefinition of ‘struct<unnamed>::A’|
i should expect that because the translation unit includes both
header1 and header 2. so then how can i automatically generate unique
namespaces, one for each of header1 and header2?
thanks.