What is noexcept useful for?

The primary use of noexcept is for generic algorithms, e.g., when resizing a std::vector<T>: for an efficient algorithm moving elements it is necessary to know ahead of time that none of the moves will throw. If moving elements might throw, elements need to be copied instead. Using the noexcept(expr) operator the library implementation can determine … Read more

Can constexpr be combined with volatile?

Yes, this is valid, there was defect report 1688: Volatile constexpr variables that was filed for this, saying: There does not appear to be language in the current wording stating that constexpr cannot be applied to a variable of volatile-qualified type. Also, the wording in 5.19 [expr.const] paragraph 2 referring to “a non-volatile object defined … Read more

Can we get the type of a lambda argument?

It’s not desirable in the general case. (Note that it’s quite easy for std::function<T(A)> to specify what e.g. argument_type is: it’s just A! It’s available in the type definition.) It would be possible to require each and every function object type to specify its argument types, and in turn mandate that the closure types generated … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)