Initial Commit
This commit is contained in:
19
examples/navigation/main.cpp
Normal file
19
examples/navigation/main.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "numbers.hpp"
|
||||
|
||||
template <Addable T>
|
||||
T twice(T value) {
|
||||
return value + value;
|
||||
}
|
||||
|
||||
// This branch syntax requires C++23.
|
||||
constexpr int evaluation_mode() {
|
||||
if consteval {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
return increment(twice(20)) + evaluation_mode();
|
||||
}
|
||||
Reference in New Issue
Block a user