Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
enum operator
#include <iostream> enum class Day { mon, tue, wed, thu, fri, sat, sun }; Day operator++(Day& d) { return d == Day::sun ? Day::mon : Day{++d}; } int main() { Day today = Day::sat; Day tomorrow = ++today; std::cout << static_cast<int>(today) << std::endl; std::cout << static_cast<int>(tomorrow) << std::endl; }
run
|
edit
|
history
|
help
0
Recursive Call Example Sum
ternary test
Rounding float to nearest 1000
Class operator overloading the subscript and boundary check for array
DESim Example with Hash Table Starter Code
C++ standard
Template arguments may contain calls to constexpr functions.
Print system time
numeric_limits
10 naturalnumbers