Is it intended by the C++ standards committee that in C++11 unordered_map destroys what it inserts?

As others have pointed out in the comments, the “universal” constructor is not, in fact, supposed to always move from its argument. It’s supposed to move if the argument is really an rvalue, and copy if it’s an lvalue. The behaviour, you observe, which always moves, is a bug in libstdc++, which is now fixed … Read more

How to list supported target architectures in clang?

So far as I can tell, there is no command-line option to list which architectures a given clang binary supports, and even running strings on it doesn’t really help. Clang is essentially just a C to LLVM translator, and it’s LLVM itself that deals with the nitty-gritty of generating actual machine code, so it’s not … Read more

Why is a simple loop optimized when the limit is 959 but not 960?

TL;DR By default, the current snapshot GCC 7 behaves inconsistently, while previous versions have default limit due to PARAM_MAX_COMPLETELY_PEEL_TIMES, which is 16. It can be overridden from command-line. The rationale of the limit is to prevent too aggressive loop unrolling, that can be a double-edged sword. GCC version <= 6.3.0 The relevant optimization option for … Read more

Clang optimization levels

I found this related question. To sum it up, to find out about compiler optimization passes: llvm-as < /dev/null | opt -O3 -disable-output -debug-pass=Arguments As pointed out in Geoff Nixon‘s answer (+1), clang additionally runs some higher level optimizations, which we can retrieve with: echo ‘int;’ | clang -xc -O3 – -o /dev/null -\#\#\# Documentation … Read more

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