File tree Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -832,6 +832,8 @@ public:
832
832
#if _HAS_CXX23
833
833
template <_Container_compatible_range<_Ty> _Rng>
834
834
void assign_range(_Rng&& _Range) {
835
+ static_assert(assignable_from<_Ty&, _RANGES range_reference_t<_Rng>>,
836
+ "Elements must be assignable from the range's reference type (N4993 [sequence.reqmts]/60).");
835
837
_Assign_range(_RANGES _Ubegin(_Range), _RANGES _Uend(_Range));
836
838
}
837
839
#endif // _HAS_CXX23
Original file line number Diff line number Diff line change @@ -967,6 +967,8 @@ public:
967
967
#if _HAS_CXX23
968
968
template <_Container_compatible_range<_Ty> _Rng>
969
969
void assign_range(_Rng&& _Range) {
970
+ static_assert(assignable_from<_Ty&, _RANGES range_reference_t<_Rng>>,
971
+ "Elements must be assignable from the range's reference type (N4993 [sequence.reqmts]/60).");
970
972
_Assign_unchecked(_RANGES _Ubegin(_Range), _RANGES _Uend(_Range));
971
973
}
972
974
#endif // _HAS_CXX23
Original file line number Diff line number Diff line change @@ -1344,6 +1344,8 @@ public:
1344
1344
#if _HAS_CXX23
1345
1345
template <_Container_compatible_range<_Ty> _Rng>
1346
1346
void assign_range(_Rng&& _Range) {
1347
+ static_assert(assignable_from<_Ty&, _RANGES range_reference_t<_Rng>>,
1348
+ "Elements must be assignable from the range's reference type (N4993 [sequence.reqmts]/60).");
1347
1349
_Assign_unchecked(_RANGES _Ubegin(_Range), _RANGES _Uend(_Range));
1348
1350
}
1349
1351
#endif // _HAS_CXX23
Original file line number Diff line number Diff line change @@ -1488,6 +1488,8 @@ public:
1488
1488
#if _HAS_CXX23
1489
1489
template <_Container_compatible_range<_Ty> _Rng>
1490
1490
constexpr void assign_range(_Rng&& _Range) {
1491
+ static_assert(assignable_from<_Ty&, _RANGES range_reference_t<_Rng>>,
1492
+ "Elements must be assignable from the range's reference type (N4993 [sequence.reqmts]/60).");
1491
1493
if constexpr (_RANGES sized_range<_Rng> || _RANGES forward_range<_Rng>) {
1492
1494
const auto _Length = _To_unsigned_like(_RANGES distance(_Range));
1493
1495
const auto _Count = _Convert_size<size_type>(_Length);
@@ -3329,6 +3331,8 @@ public:
3329
3331
3330
3332
template <_Container_compatible_range<bool> _Rng>
3331
3333
constexpr void assign_range(_Rng&& _Range) {
3334
+ static_assert(assignable_from<bool&, _RANGES range_reference_t<_Rng>>,
3335
+ "Elements must be assignable from the range's reference type (N4993 [sequence.reqmts]/60).");
3332
3336
clear();
3333
3337
if constexpr (_RANGES forward_range<_Rng> || _RANGES sized_range<_Rng>) {
3334
3338
const auto _Length = _To_unsigned_like(_RANGES distance(_Range));
You can’t perform that action at this time.
0 commit comments