Skip to content

Commit

Permalink
refactor(expression): delete the move assignment operator
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsingh19975 committed Feb 15, 2022
1 parent 60bc6f7 commit 84cf964
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/boost/numeric/ublas/tensor/expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ struct tensor_expression
/// @brief The copy constructor is deleted to avoid expensive copies or sometimes object slicing.
tensor_expression(const tensor_expression&) = delete;
tensor_expression& operator=(const tensor_expression&) = delete;
constexpr tensor_expression& operator=(tensor_expression&&) noexcept = delete;

/**
* @brief This is the only way to discourage the users from using `std::move` on the local
Expand All @@ -142,7 +143,6 @@ struct tensor_expression
*/
protected :
constexpr tensor_expression(tensor_expression&&) noexcept = default;
constexpr tensor_expression& operator=(tensor_expression&&) noexcept = default;
explicit tensor_expression() = default;

/// @brief This the only way to access the protected move constructor of other expressions.
Expand Down Expand Up @@ -176,6 +176,7 @@ struct binary_tensor_expression
/// @brief The copy constructor is deleted to avoid expensive copies or sometimes object slicing.
binary_tensor_expression(const binary_tensor_expression& l) = delete;
binary_tensor_expression& operator=(binary_tensor_expression const& l) noexcept = delete;
constexpr binary_tensor_expression& operator=(binary_tensor_expression&& l) noexcept = delete;

[[nodiscard]] constexpr auto const& left_expr() const noexcept{ return cast_tensor_expression(el); }
[[nodiscard]] constexpr auto const& right_expr() const noexcept{ return cast_tensor_expression(er); }
Expand All @@ -196,7 +197,6 @@ struct binary_tensor_expression
*/
protected:
constexpr binary_tensor_expression(binary_tensor_expression&& l) noexcept = default;
constexpr binary_tensor_expression& operator=(binary_tensor_expression&& l) noexcept = default;

/// @brief This the only way to access the protected move constructor of other expressions.
template<class, class, class> friend struct unary_tensor_expression;
Expand Down Expand Up @@ -250,6 +250,7 @@ struct unary_tensor_expression
/// @brief The copy constructor is deleted to avoid expensive copies or sometimes object slicing.
unary_tensor_expression(unary_tensor_expression const& l) = delete;
unary_tensor_expression& operator=(unary_tensor_expression const& l) noexcept = delete;
constexpr unary_tensor_expression& operator=(unary_tensor_expression&& l) noexcept = delete;

[[nodiscard]] constexpr auto const& expr() const noexcept{ return cast_tensor_expression(e); }

Expand All @@ -269,7 +270,6 @@ struct unary_tensor_expression
*/
protected:
constexpr unary_tensor_expression(unary_tensor_expression&& l) noexcept = default;
constexpr unary_tensor_expression& operator=(unary_tensor_expression&& l) noexcept = default;

/// @brief This the only way to access the protected move constructor of other expressions.
template<class, class, class> friend struct unary_tensor_expression;
Expand Down

0 comments on commit 84cf964

Please sign in to comment.