Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
vv
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> #include <set> struct Matrix{ static constexpr int base = 5; int a[base][base]; Matrix(){ for(int line = 0; line < Matrix::base; ++line){ for(int column = 0; column < Matrix::base; ++column){ a[line][column] = 0; } } } }; bool operator<(const Matrix &left, const Matrix &right){ for(int line = 0; line < Matrix::base; ++line){ for(int column = 0; column < Matrix::base; ++column){ if(left.a[line][column] != right.a[line][column]){ return left.a[line][column] < right.a[line][column]; } } } return false; } int main(){ Matrix a; a.a[1][0] = 1; Matrix b; b.a[0][1] = 1; Matrix c; c.a[0][1] = 2; //false std::cout << std::boolalpha << (a < a) << std::endl; //true false std::cout << std::boolalpha << (a < b) << " " << (b < a) << std::endl; //true true true std::cout << std::boolalpha << (a < b) << " " << (b < c) << " " << (a < c) << std::endl; }
cl.exe
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 1,61 sec, absolute running time: 0,32 sec, absolute service time: 1,94 sec
fork mode
|
history
false true false true true true