I have a type that cannot be moved or copied (making private constructors and operators private). But when I tried to compile std :: list of them, the operation ended with a very strange error (class name is abbreviated for brevity).
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmemory(202)
: error C2248: 'T::T' : cannot access private member declared in class 'T'
Undoubtedly, this does not apply to the type in the linked list, which can be movable or copied.
When these members become publicly available, the code compiles even though if std :: list tried to access them, it would be unresolved external, as they were declared private only. It makes no sense: (
Puppy source
share