Solved: 32 - Constexpr and Nullptr
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace cpp11 {
|
||||
|
||||
auto to_index(Color color) -> int {
|
||||
auto to_index(const Color color) -> int {
|
||||
switch (color) {
|
||||
case Color::Red: return 0;
|
||||
case Color::Green: return 1;
|
||||
@@ -11,14 +11,12 @@ auto to_index(Color color) -> int {
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto square(int value) -> int {
|
||||
(void)value;
|
||||
return 0;
|
||||
auto square(const int value) -> int {
|
||||
return value * value;
|
||||
}
|
||||
|
||||
auto find_null(int* ptr) -> int* {
|
||||
(void)ptr;
|
||||
return nullptr;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
} // namespace cpp11
|
||||
|
||||
Reference in New Issue
Block a user