online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <map> #include <set> #include <iostream> class my_class_t { public: my_class_t(int x, int y) : m_x{x}, m_y{y} { } friend auto operator<=>(const my_class_t& lhs, const my_class_t& rhs); private: int m_x; int m_y; }; auto operator<=>(const my_class_t& lhs, const my_class_t& rhs) { if (lhs.m_x == rhs.m_x) { return lhs.m_y <=> rhs.m_y; } return lhs.m_x <=> rhs.m_x; } int main() { std::set<my_class_t> set{{1,1},{2,1},{2,2}}; std::map<my_class_t,int> map{{{1,1},1}, {{1,2},2}}; int value = map[{1,2}]; std::cout << value; return value; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue