Skip to content

Commit 4302ac9

Browse files
Explicitly delete disabled constructor/assignment
1 parent c5762c9 commit 4302ac9

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

include/beman/any_view/any_view.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,20 @@ class any_view : public std::ranges::view_interface<any_view<ElementT, OptionsV,
4949
static constexpr bool simple = (OptionsV & any_view_options::simple) == any_view_options::simple;
5050

5151
public:
52+
any_view(const any_view&)
53+
requires(not copyable)
54+
= delete;
55+
5256
constexpr any_view(const any_view&)
5357
requires copyable
5458
= default;
5559

5660
constexpr any_view(any_view&&) noexcept = default;
5761

62+
auto operator=(const any_view&) -> any_view&
63+
requires(not copyable)
64+
= delete;
65+
5866
constexpr auto operator=(const any_view&) -> any_view&
5967
requires copyable
6068
= default;

include/beman/any_view/any_view_options.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ template <class RefT,
9797
class DiffT = std::ptrdiff_t>
9898
struct any_view_options {
9999
type_t<RefT> reference_type;
100-
type_t<IterConceptT> iterator_concept;
101-
bool sized;
102-
bool BEMAN_ANY_VIEW_OPTION();
103-
bool borrowed;
104-
bool simple;
105-
type_t<RValueRefT> rvalue_reference_type;
106-
type_t<DiffT> difference_type;
100+
type_t<IterConceptT> iterator_concept = {};
101+
bool sized = false;
102+
bool BEMAN_ANY_VIEW_OPTION() = false;
103+
bool borrowed = false;
104+
bool simple = false;
105+
type_t<RValueRefT> rvalue_reference_type = {};
106+
type_t<DiffT> difference_type = {};
107107
};
108108

109109
#endif

0 commit comments

Comments
 (0)