If in CLion 2016.3.2 you start a new project and modify the main.cpp file as follows:
#include <utility> #include <vector> int main() { int a=0,b=1; std::swap(a,b); return 0; } That IDE will report an error: that it cannot find the std::swap function with the correct signature, while offering options from stl_bvector.h , for example, inline void swap(_Bit_reference __x, _Bit_reference __y) noexcept . The code is obviously compiled normally. If you remove the second line, then there will be no error.
It is also impossible to “suppress” this error, Alt + Enter on the line with an error does not work.
How to get rid of this error?
#include <algorithm>forgot - Sublihim<utility>ru.cppreference.com/w/cpp/algorithm/swap In any case, the error remains. - Im ieeestd::swap<int,int>(a,b)And which compiler in CLion? - Sublihim<int>. Write the answer, I will accept it. CLion uses the system compiler, and, for error analysis, apparently, its parser. - Im ieee