std::type_info::hash_code() uniqueness and the meaning of “should”

怎甘沉沦 提交于 2019-12-05 01:20:25

The meaning looks pretty clear to me: it's not an absolute requirement because it may be impossible to meet under some circumstances, but the implementation should attempt to produce unique values to the extent possible.

I'd note that the same is true of hash codes in general -- you try to produce values that are unique, but it's not always possible.

The standard contains a lot of information that's not enforceable. Quite a bit (but certainly not all) is in the form of explicit Notes, but that doesn't mean everything non-normative outside a Note is a defect.

Edit: in case anybody wants to know what the ISO says about how standards should be written, they have a page of guidelines.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!