|
|
|
|
|
by s-luv-j
1764 days ago
|
|
Is it just me, or have C++ errors gotten a lot better? Below example from guide seems a lot more ergonomic than in years past. test.cpp: In instantiation of ‘T add(T, T) [with T = std::basic_string<char>]’:
test.cpp:17:21: required from here
test.cpp:11:22: error: static assertion failed
11 | static_assert(std::is_integral_v<T>);
| ~~~~~^~~~~~~~~~~~~~~~
test.cpp:11:22: note: ‘std::is_integral_v<std::basic_string<char> >’ evaluates to false
Build finished with error(s). |
|
See https://clang.llvm.org/diagnostics.html ; that page is not dated, but compares to gcc 4.9, which is from April 22, 2014.
gcc also has worked on improving its error messages (most likely because of competition with clang), so that comparison probably isn’t accurate anymore.