Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
NaN inside set
//clang 3.8.0 #include <iostream> #include <set> #include <limits> int main() { double nan = std::numeric_limits<double>::quiet_NaN(); std::set<double> s {nan, 1}; auto r = s.find(1); if (r != s.end()) std::cout << "1 is found" << std::endl; else std::cout << "1 is not found" << std::endl; auto p = s.find(2); if (p != s.end()) std::cout << "2 is found" << std::endl; else std::cout << "2 is not found" << std::endl; auto q = s.find(nan); if (q != s.end()) std::cout << "nan is found" << std::endl; else std::cout << "nan is not found" << std::endl; std::cout << "size is " << s.size() << std::endl; std::cout << "contents are :" << std::endl; for (auto i : s) std::cout << i << std::endl; }
run
|
edit
|
history
|
help
0
First test
Store Information in Structure and Display it
Access namespace by unqualified manner
MiniumNumberDivideConquer
regex
Example of custom deleter to manage a resource.
Initialise arrays with N number
C++ Register
Narrowing error
HTML Timetable generator.cpp