c++ - Private Accessibility
- Gregg <no spam.com> Sep 22 2006
The following code compiles successfully with GCC GNU 4.1.1, MSVC 8.0, Comeau
4.3.x, and EDG/C++ but not with DMC 8.49.4. Is DMC correct or can this
situation be fixed in DMC (besides by moving B to public accessibility)?
Thanks.
#include <vector>
class A {
private:
struct B{};
static std::vector<B> m;
};
std::vector<A::B> A::m;
int main(){
return 0;
}
std::vector<A::B> A::m;
^
access.cpp(9) : Error: member 'A::B' of class 'A' is not accessible
--- errorlevel 1
Sep 22 2006








Gregg <no spam.com>