Skip to content

Commit

Permalink
refactor: Leverage std::unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
oboukli committed Nov 13, 2024
1 parent d53cc4f commit 099f9e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ leveraged by this project:
| Concatenation of array | C++17 | [`include/forfun/array_concatenation.hpp`](include/forfun/array_concatenation.hpp) |
| Contains duplicate | C++20 | [`include/forfun/contains_duplicate.hpp`](include/forfun/contains_duplicate.hpp) |
| Depth-first search | C++20 | [`include/forfun/graph/depth_first_search.hpp`](include/forfun/graph/depth_first_search.hpp) |
| Evaluate reverse polish notation | C++20 | [`include/forfun/evaluate_reverse_polish_notation.hpp`](include/forfun/evaluate_reverse_polish_notation.hpp) |
| Evaluate reverse polish notation | C++23 | [`include/forfun/evaluate_reverse_polish_notation.hpp`](include/forfun/evaluate_reverse_polish_notation.hpp) |
| Factorial | C++23 | [`include/forfun/factorial.hpp`](include/forfun/factorial.hpp) |
| Fibonacci sequence | C++20 | [`include/forfun/fibonacci_sequence.hpp`](include/forfun/fibonacci_sequence.hpp) |
| First missing positive | C++20 | [`include/forfun/first_missing_positive.hpp`](include/forfun/first_missing_positive.hpp) |
Expand Down
4 changes: 2 additions & 2 deletions include/forfun/evaluate_reverse_polish_notation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ template <std::contiguous_iterator Iter, std::sentinel_for<Iter> Sentinel>
accumulator /= operand_2;
break;
default:
assert(false);
std::unreachable();
}
}
}
Expand Down Expand Up @@ -224,7 +224,7 @@ template <std::contiguous_iterator Iter, std::sentinel_for<Iter> Sentinel>
accumulator /= operand_2;
break;
default:
assert(false);
std::unreachable();
}
}
}
Expand Down

0 comments on commit 099f9e4

Please sign in to comment.