Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
GetTypeName
Расстановка восьми ферзей на шахматной доске так, чтобы ни один не угрожал другому - C++
Test size_t
vector destruction - clang
std::reference_wrapper
return reference (clang)
template specialization inheritance problem
<string> No indirect include of <errno.h>
move_string
Maze problem solution
Please log in to post a comment.