Skip to content

Commit

Permalink
Explicitly delete disabled constructor/assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickroberts committed Jan 29, 2025
1 parent c5762c9 commit 4302ac9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions include/beman/any_view/any_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ class any_view : public std::ranges::view_interface<any_view<ElementT, OptionsV,
static constexpr bool simple = (OptionsV & any_view_options::simple) == any_view_options::simple;

public:
any_view(const any_view&)
requires(not copyable)
= delete;

constexpr any_view(const any_view&)
requires copyable
= default;

constexpr any_view(any_view&&) noexcept = default;

auto operator=(const any_view&) -> any_view&
requires(not copyable)
= delete;

constexpr auto operator=(const any_view&) -> any_view&
requires copyable
= default;
Expand Down
14 changes: 7 additions & 7 deletions include/beman/any_view/any_view_options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ template <class RefT,
class DiffT = std::ptrdiff_t>
struct any_view_options {
type_t<RefT> reference_type;
type_t<IterConceptT> iterator_concept;
bool sized;
bool BEMAN_ANY_VIEW_OPTION();
bool borrowed;
bool simple;
type_t<RValueRefT> rvalue_reference_type;
type_t<DiffT> difference_type;
type_t<IterConceptT> iterator_concept = {};
bool sized = false;
bool BEMAN_ANY_VIEW_OPTION() = false;
bool borrowed = false;
bool simple = false;
type_t<RValueRefT> rvalue_reference_type = {};
type_t<DiffT> difference_type = {};
};

#endif
Expand Down

0 comments on commit 4302ac9

Please sign in to comment.