| Должно ли это компилироваться (вложенные private классы)? | |
| От: | Xentrax | ||
| Дата: | 29.05.08 17:09 |
Имеем вложенный закрытый класс с пользовательским оператором delete. Попытка использовать std::tr1::shared_ptr<> обламывается в VC2008 на шаблонной функции. Вот упрощенный пример:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. cl15.cpp cl15.cpp(5) : error C2248: 'A::B' : cannot access private class declared in class 'A' cl15.cpp(12) : see declaration of 'A::B' cl15.cpp(9) : see declaration of 'A' cl15.cpp(17) : see reference to function template instantiation 'void destroy<A::B>(T *)' being compiled with [ T=A::B ] Вот так вариант с shared_ptr<>
|