Re: unordered_map экземпляров класса-владельца
От: _NN_ www.nemerleweb.com
Дата: 08.07.20 14:54
Оценка: 1 (1) +1
Здравствуйте, sergii.p, Вы писали:

SP>всё нормально. Кто-то может объяснить почему?

Потому что нет требования стандарта это компилировать.
Отдано на откуп реализации.

https://stackoverflow.com/a/13089641

17.6.4.8:

In certain cases (replacement functions, handler functions, operations on types used to instantiate standard library template components), the C++ standard library depends on components supplied by a C++ program. If these components do not meet their requirements, the Standard places no requirements on the implementation.

In particular, the effects are undefined in the following cases:

...

if an incomplete type is used as a template argument when instantiating a template component, unless specifically allowed for that component.


SP>microsoft компилирует оба варианта. Это gcc так выделывается.


Судя по всему GCC в обозримом будущем и не будет компилировать.
http://rsdn.nemerleweb.com
http://nemerleweb.com
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.