Skip to content

Commit

Permalink
Properly fixed the issue of shape<> not being trivially copyable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Domagoj Šarić committed Aug 9, 2023
1 parent 6afa7f7 commit f4cd4ed
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions include/kwk/utility/container/shape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ namespace kwk
//! @tparam D List of @ref glossary-extent types
//====================================================================================================================
template<auto... D>
struct
#ifdef __clang__
[[clang::trivial_abi]]
#endif
shape : __::prefilled_t<D...>::type
struct shape : __::prefilled_t<D...>::type
{
using parent = typename __::prefilled_t<D...>::type;
using constraint_t = KWK_DEFAULT_SHAPE_CONSTRAINTS;
Expand Down Expand Up @@ -184,8 +180,7 @@ namespace kwk
//==================================================================================================================
/// Copy constructor
//==================================================================================================================
KWK_TRIVIAL constexpr shape(shape const& d) noexcept : parent(d)
{}
constexpr shape(shape const&) noexcept = default;

//==================================================================================================================
//! @brief Construct shape from another shape type
Expand All @@ -209,15 +204,11 @@ namespace kwk
//==================================================================================================================
/// Assignment operator
//==================================================================================================================
constexpr shape& operator=( shape const& other ) & noexcept
{
this->__base() = other.__base();
return *this;
}
constexpr shape& operator=( shape const& other ) noexcept = default;

template<auto... D2>
requires( constraint_t::is_contructible_from<parent{},typename shape<D2...>::parent{}>() )
constexpr shape& operator=( shape<D2...> const& other ) & noexcept
constexpr shape& operator=( shape<D2...> const& other ) noexcept
{
constraint_t::construct(*this, other);
return *this;
Expand Down

0 comments on commit f4cd4ed

Please sign in to comment.