Is it legal for the compiler to degrade the time complexity of a program? Is this considered observable behavior?

The C standard doesn’t actually have a time complexity model, neither for its primitive operations, nor its library functions, so compilers are allowed to do pretty much anything that preserves program semantics (observable behavior). The C++ standard only gives complexity guarantees only for some its library functions, and says (17.5.1.4 [structure.specifications]): Complexity requirements specified in … Read more

Why is unique_ptr not equality_comparable_with nullptr_t in C++20?

TL;DR: std::equality_comparable_with<T, U> requires that both T and U are convertible to the common reference of T and U. For the case of std::unique_ptr<T> and std::nullptr_t, this requires that std::unique_ptr<T> is copy-constructible, which it is not. Buckle in. This is quite the ride. Consider me nerd-sniped. Why don’t we satisfy the concept? std::equality_comparable_with requires: template … Read more

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