Re[5]: Копирование базовых подо
От: Bork СССР  
Дата: 13.08.04 03:24
Оценка:
Здравствуйте, sergey_shandar, Вы писали:

_>Не соответствует стандарту. См. стандарт:

_>

_>12.8.8.
_>The implicitly-defined copy constructor for class X performs a memberwise copy of its subobjects. The
_>order of copying is the same as the order of initialization of bases and members in a user-defined constructor
_>(see 12.6.2). Each subobject is copied in the manner appropriate to its type:
_>— if the subobject is of class type, the copy constructor for the class is used;
_>— if the subobject is an array, each element is copied, in the manner appropriate to the element type;
_>— if the subobject is of scalar type, the built-in assignment operator is used.



хехе ключевое слово в этой выдержке — "The implicitly-defined copy constructor". А где в своем примере ты видишь это implicitly-defined ? если у тебя определен пользовательский конструктор B(C), который подходит к ситуации лучше, т.к. не требует приведения типов.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.