Solved: 32 - Constexpr and Nullptr

This commit is contained in:
2026-08-17 21:35:13 +03:00
parent 3131313253
commit 8807a9228c
+4 -6
View File
@@ -2,7 +2,7 @@
namespace cpp11 { namespace cpp11 {
auto to_index(Color color) -> int { auto to_index(const Color color) -> int {
switch (color) { switch (color) {
case Color::Red: return 0; case Color::Red: return 0;
case Color::Green: return 1; case Color::Green: return 1;
@@ -11,14 +11,12 @@ auto to_index(Color color) -> int {
return -1; return -1;
} }
auto square(int value) -> int { auto square(const int value) -> int {
(void)value; return value * value;
return 0;
} }
auto find_null(int* ptr) -> int* { auto find_null(int* ptr) -> int* {
(void)ptr; return ptr;
return nullptr;
} }
} // namespace cpp11 } // namespace cpp11