Skip to content

Commit

Permalink
default copy and move ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
liss-h committed Dec 10, 2024
1 parent 8cf85ac commit 301328a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions include/dice/template-library/polymorphic_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,23 +345,16 @@ namespace dice::template_library {

public:
constexpr offset_ptr_stl_allocator() noexcept(std::is_nothrow_default_constructible_v<upstream_allocator_type>) = default;

constexpr offset_ptr_stl_allocator(offset_ptr_stl_allocator const &other) noexcept(std::is_nothrow_copy_constructible_v<upstream_allocator_type>)
: inner_{other.inner_} {
}

constexpr offset_ptr_stl_allocator(offset_ptr_stl_allocator &&other) noexcept(std::is_nothrow_move_constructible_v<upstream_allocator_type>)
: inner_{other.inner_} {
}
constexpr offset_ptr_stl_allocator(offset_ptr_stl_allocator const &other) noexcept = default;
constexpr offset_ptr_stl_allocator(offset_ptr_stl_allocator &&other) noexcept = default;
constexpr offset_ptr_stl_allocator &operator=(offset_ptr_stl_allocator const &other) noexcept(std::is_nothrow_copy_assignable_v<upstream_allocator_type>) = default;
constexpr offset_ptr_stl_allocator &operator=(offset_ptr_stl_allocator &&other) noexcept(std::is_nothrow_move_assignable_v<upstream_allocator_type>) = default;

template<typename U>
constexpr offset_ptr_stl_allocator(offset_ptr_stl_allocator<U, Allocator> const &other) noexcept
: inner_{other.inner_} {
}

constexpr offset_ptr_stl_allocator &operator=(offset_ptr_stl_allocator const &other) noexcept(std::is_nothrow_copy_assignable_v<upstream_allocator_type>) = default;
constexpr offset_ptr_stl_allocator &operator=(offset_ptr_stl_allocator &&other) noexcept(std::is_nothrow_move_assignable_v<upstream_allocator_type>) = default;

explicit constexpr offset_ptr_stl_allocator(upstream_allocator_type const &upstream) noexcept(std::is_nothrow_copy_constructible_v<upstream_allocator_type>)
: inner_{upstream} {
}
Expand Down

0 comments on commit 301328a

Please sign in to comment.