Skip to content

Commit

Permalink
<stack>, <queue>: Add std::forward for append_range (#5168)
Browse files Browse the repository at this point in the history
  • Loading branch information
hewillk authored Dec 13, 2024
1 parent 2378c81 commit 1a31980
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions stl/inc/queue
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public:
#if _HAS_CXX23
template <_Container_compatible_range<_Ty> _Rng>
void push_range(_Rng&& _Range) {
if constexpr (requires { c.append_range(_Range); }) {
c.append_range(_Range);
if constexpr (requires { c.append_range(_STD forward<_Rng>(_Range)); }) {
c.append_range(_STD forward<_Rng>(_Range));
} else {
_RANGES copy(_Range, back_insert_iterator{c});
}
Expand Down Expand Up @@ -394,8 +394,8 @@ public:
void push_range(_Rng&& _Range) {
const size_type _Old_size = c.size();

if constexpr (requires { c.append_range(_Range); }) {
c.append_range(_Range);
if constexpr (requires { c.append_range(_STD forward<_Rng>(_Range)); }) {
c.append_range(_STD forward<_Rng>(_Range));
} else {
_RANGES copy(_Range, back_insert_iterator{c});
}
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/stack
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public:
#if _HAS_CXX23
template <_Container_compatible_range<_Ty> _Rng>
void push_range(_Rng&& _Range) {
if constexpr (requires { c.append_range(_Range); }) {
c.append_range(_Range);
if constexpr (requires { c.append_range(_STD forward<_Rng>(_Range)); }) {
c.append_range(_STD forward<_Rng>(_Range));
} else {
_RANGES copy(_Range, back_insert_iterator{c});
}
Expand Down

0 comments on commit 1a31980

Please sign in to comment.