Skip to content

Commit

Permalink
Cleanup: remove unneeded [[maybe_unused]] annotations (#920)
Browse files Browse the repository at this point in the history
... from variables that are used only on some `if constexpr` branches.
  • Loading branch information
CaseyCarter authored Jun 30, 2020
1 parent ac5c8b0 commit 3f6c715
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ namespace ranges {

// FUNCTION TEMPLATE _Rewrap_subrange
template <class _Result, class _Wrapped, class _Unwrapped>
_NODISCARD constexpr _Result _Rewrap_subrange(
[[maybe_unused]] _Wrapped& _First, [[maybe_unused]] subrange<_Unwrapped>&& _UResult) {
_NODISCARD constexpr _Result _Rewrap_subrange(_Wrapped& _First, subrange<_Unwrapped>&& _UResult) {
// conditionally computes a wrapped subrange from a wrapped iterator and unwrapped subrange
_STL_INTERNAL_STATIC_ASSERT(is_same_v<_Unwrapped_t<_Wrapped>, _Unwrapped>);
if constexpr (is_same_v<_Result, dangling>) {
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -2878,7 +2878,7 @@ namespace ranges {
// clang-format off
template <class _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()([[maybe_unused]] _Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
if constexpr (_Choice<_Ty&>._Strategy == _St::_Array) {
// extent_v<remove_cvref_t<_Ty&>> reuses specializations from _Choose
return extent_v<remove_cvref_t<_Ty&>>;
Expand Down Expand Up @@ -2950,7 +2950,7 @@ namespace ranges {
// clang-format off
template <class _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr bool operator()([[maybe_unused]] _Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD constexpr bool operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
if constexpr (_Choice<_Ty&>._Strategy == _St::_Member) {
return static_cast<bool>(_Val.empty());
} else if constexpr (_Choice<_Ty&>._Strategy == _St::_Size) {
Expand Down

0 comments on commit 3f6c715

Please sign in to comment.