Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
34534
#include <iostream> #include <vector> struct alma { alma(int x) : x(x) {} bool operator==(const alma& rhs) const noexcept { return x == rhs.x; } int x; }; int main() { std::vector<alma> x(1, alma{0}); // the way you shoudl initilaize this std::vector<alma> y = std::vector<alma>{ alma{0} }; // the way you did std::cout << (x == y); }
run
|
edit
|
history
|
help
0
EBO
Error
test string
wasm test for node
Recursive Enumeration Example
applidiumResto_NicolasCarre
Clang-IsBaseOf
Unlike C (even C99/C11), C++ allows initializers in if-conditions, so this compiles.
C++ Standard Template Library
bubble sort