Skip to content

Commit 479c6a8

Browse files
jensmaurertkoeppe
authored andcommitted
P2325R3 Views should not be required to be default constructible
Also fixes LWG3479. - Conflicts addressed by assuming P2328R0 was applied. - Used non-propagating-cache for split_view.
1 parent 6fd094c commit 479c6a8

File tree

5 files changed

+81
-91
lines changed

5 files changed

+81
-91
lines changed

source/containers.tex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10866,8 +10866,7 @@
1086610866
class span;
1086710867

1086810868
template<class ElementType, size_t Extent>
10869-
inline constexpr bool ranges::enable_view<span<ElementType, Extent>> =
10870-
Extent == 0 || Extent == dynamic_extent;
10869+
inline constexpr bool ranges::enable_view<span<ElementType, Extent>> = true;
1087110870
template<class ElementType, size_t Extent>
1087210871
inline constexpr bool ranges::enable_borrowed_range<span<ElementType, Extent>> = true;
1087310872

source/iterators.tex

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@
13191319

13201320
template<class I>
13211321
concept @\deflibconcept{weakly_incrementable}@ =
1322-
@\libconcept{default_initializable}@<I> && @\libconcept{movable}@<I> &&
1322+
@\libconcept{movable}@<I> &&
13231323
requires(I i) {
13241324
typename iter_difference_t<I>;
13251325
requires @\exposid{is-signed-integer-like}@<iter_difference_t<I>>;
@@ -3721,7 +3721,7 @@
37213721
template<class Container>
37223722
class back_insert_iterator {
37233723
protected:
3724-
Container* container = nullptr;
3724+
Container* container;
37253725

37263726
public:
37273727
using iterator_category = output_iterator_tag;
@@ -3731,7 +3731,6 @@
37313731
using reference = void;
37323732
using container_type = Container;
37333733

3734-
constexpr back_insert_iterator() noexcept = default;
37353734
constexpr explicit back_insert_iterator(Container& x);
37363735
constexpr back_insert_iterator& operator=(const typename Container::value_type& value);
37373736
constexpr back_insert_iterator& operator=(typename Container::value_type&& value);
@@ -3833,7 +3832,7 @@
38333832
template<class Container>
38343833
class front_insert_iterator {
38353834
protected:
3836-
Container* container = nullptr;
3835+
Container* container;
38373836

38383837
public:
38393838
using iterator_category = output_iterator_tag;
@@ -3843,7 +3842,6 @@
38433842
using reference = void;
38443843
using container_type = Container;
38453844

3846-
constexpr front_insert_iterator() noexcept = default;
38473845
constexpr explicit front_insert_iterator(Container& x);
38483846
constexpr front_insert_iterator& operator=(const typename Container::value_type& value);
38493847
constexpr front_insert_iterator& operator=(typename Container::value_type&& value);
@@ -3945,8 +3943,8 @@
39453943
template<class Container>
39463944
class insert_iterator {
39473945
protected:
3948-
Container* container = nullptr;
3949-
ranges::iterator_t<Container> iter = ranges::iterator_t<Container>();
3946+
Container* container;
3947+
ranges::iterator_t<Container> iter;
39503948

39513949
public:
39523950
using iterator_category = output_iterator_tag;
@@ -3956,7 +3954,6 @@
39563954
using reference = void;
39573955
using container_type = Container;
39583956

3959-
insert_iterator() = default;
39603957
constexpr insert_iterator(Container& x, ranges::iterator_t<Container> i);
39613958
constexpr insert_iterator& operator=(const typename Container::value_type& value);
39623959
constexpr insert_iterator& operator=(typename Container::value_type&& value);
@@ -4732,7 +4729,7 @@
47324729
requires (!@\libconcept{same_as}@<I, S> && @\libconcept{copyable}@<I>)
47334730
class common_iterator {
47344731
public:
4735-
constexpr common_iterator() = default;
4732+
constexpr common_iterator() requires @\libconcept{default_initializable}@<I> = default;
47364733
constexpr common_iterator(I i);
47374734
constexpr common_iterator(S s);
47384735
template<class I2, class S2>
@@ -5200,7 +5197,7 @@
52005197
// if the \grammarterm{qualified-id} \tcode{I::iterator_concept} is valid and denotes a type
52015198
using iterator_category = typename I::iterator_category; // present only
52025199
// if the \grammarterm{qualified-id} \tcode{I::iterator_category} is valid and denotes a type
5203-
constexpr counted_iterator() = default;
5200+
constexpr counted_iterator() requires @\libconcept{default_initializable}@<I> = default;
52045201
constexpr counted_iterator(I x, iter_difference_t<I> n);
52055202
template<class I2>
52065203
requires @\libconcept{convertible_to}@<const I2&, I>
@@ -6028,7 +6025,6 @@
60286025
using traits_type = traits;
60296026
using ostream_type = basic_ostream<charT,traits>;
60306027

6031-
constexpr ostream_iterator() noexcept = default;
60326028
ostream_iterator(ostream_type& s);
60336029
ostream_iterator(ostream_type& s, const charT* delimiter);
60346030
ostream_iterator(const ostream_iterator& x);
@@ -6041,8 +6037,8 @@
60416037
ostream_iterator& operator++(int);
60426038

60436039
private:
6044-
basic_ostream<charT,traits>* out_stream = nullptr; // \expos
6045-
const charT* delim = nullptr; // \expos
6040+
basic_ostream<charT,traits>* out_stream; // \expos
6041+
const charT* delim; // \expos
60466042
};
60476043
}
60486044
\end{codeblock}
@@ -6390,7 +6386,6 @@
63906386
using streambuf_type = basic_streambuf<charT,traits>;
63916387
using ostream_type = basic_ostream<charT,traits>;
63926388

6393-
constexpr ostreambuf_iterator() noexcept = default;
63946389
ostreambuf_iterator(ostream_type& s) noexcept;
63956390
ostreambuf_iterator(streambuf_type* s) noexcept;
63966391
ostreambuf_iterator& operator=(charT c);
@@ -6401,7 +6396,7 @@
64016396
bool failed() const noexcept;
64026397

64036398
private:
6404-
streambuf_type* sbuf_ = nullptr; // \expos
6399+
streambuf_type* sbuf_; // \expos
64056400
};
64066401
}
64076402
\end{codeblock}

0 commit comments

Comments
 (0)