regular-type

C++11: Are there reasons why some Regular Types should not have `std::hash` specialised?

给你一囗甜甜゛ 提交于 2019-12-06 17:25:35
问题 With a Regular Type, I mean the definition of Stepanov in Elements of Programming , basically, that there's the concept of equality and that objects which are copies of each other compare equal. So when you have a Regular Type T , and the equality relation is transitive ( a == b && b == c => a == c ), you can define a ( non-trivial ) hash function which is consistent with the definition of equality ( a == b => h(a) == h(b) ). Always. But the standard doesn't include many std::hash

Is there a way to disable auto declaration for non regular types?

谁说胖子不能爱 提交于 2019-12-04 00:42:17
问题 UPDATE: There is a proposal to change the meaning of auto in certain situations. Implicit Evaluation of “auto” Variables and Arguments by Joel Falcou and others. The implicit evaluation shall: Enable class implementers to indicate that objects of this class are evaluated in an auto statement; Enable them to determine the type of the evaluated object; ... C++11's auto keyword is great. However in my opinion if a type is Not Regular (see for example, What is a "Regular Type" in the context of

Is there a way to disable auto declaration for non regular types?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 03:23:04
UPDATE: There is a proposal to change the meaning of auto in certain situations. Implicit Evaluation of “auto” Variables and Arguments by Joel Falcou and others. The implicit evaluation shall: Enable class implementers to indicate that objects of this class are evaluated in an auto statement; Enable them to determine the type of the evaluated object; ... C++11's auto keyword is great. However in my opinion if a type is Not Regular (see for example, What is a "Regular Type" in the context of move semantics? ) the usage of auto becomes tricky. Is there a way to disable the auto declaration for