Guillaume Papin(@Sarcasm) has a thorough article about compilation databases.
% mkdir build
% (cd build; cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES ..)
% ln -s build/compile_commands.json
Guillaume Papin(@Sarcasm) has a thorough article about compilation databases.
% mkdir build
% (cd build; cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES ..)
% ln -s build/compile_commands.json
theme | class | highlighter | fonts | ||||||
---|---|---|---|---|---|---|---|---|---|
default |
text-center |
MaskRay |
|
option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)if (${FORCE_COLORED_OUTPUT}) | |
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | |
add_compile_options (-fdiagnostics-color=always) | |
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | |
add_compile_options (-fcolor-diagnostics) | |
endif () | |
endif () |
C++20 takes yet another swing at its infamous initialization rules. The players involved this time are Aggregate initialization (type a{1, 2, 3}
) and direct initialization (type a(1, 2, 3)
). A common pitfall with aggregate init is:
std::vector<int> vec0(5, 9); // 9, 9, 9, 9, 9
std::vector<int> vec1{5, 9}; // 5, 9
So if you don't know what you're doing, {}
is potentially dangerous to use with types that might have both "real" constructors and such with std::initializer_list
. If you had your head in the sand for 10 11 years and always used ()
then you never were in danger.