diff --git a/include/boost/numeric/ublas/tensor/expression.hpp b/include/boost/numeric/ublas/tensor/expression.hpp index 547fb4f9d..ad72157a3 100644 --- a/include/boost/numeric/ublas/tensor/expression.hpp +++ b/include/boost/numeric/ublas/tensor/expression.hpp @@ -130,18 +130,18 @@ struct tensor_expression 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 - * expression because it works differently from the standard way to move the objects. This weird - * behaviour is due to `const reference`, which is impossible to move without constructing a new object. - * If the variable goes out of the scope, stored as a `const reference` inside the expression, - * it will be destroyed that will result in a dangling pointer. But this behaviour is helpful - * for the construction of an expression because the expression might contain a `const reference` - * object that will be passed around as a `const reference` rather than a copy, and we do not need to - * construct a whole new chunky object because, under the hood, we are just passing pointers around. - * - */ protected : + /** + * @brief This is the only way to discourage the users from using `std::move` on the local + * expression because it works differently from the standard way to move the objects. This weird + * behaviour is due to `const reference`, which is impossible to move without constructing a new object. + * If the variable goes out of the scope, stored as a `const reference` inside the expression, + * it will be destroyed that will result in a dangling pointer. But this behaviour is helpful + * for the construction of an expression because the expression might contain a `const reference` + * object that will be passed around as a `const reference` rather than a copy, and we do not need to + * construct a whole new chunky object because, under the hood, we are just passing pointers around. + * + */ constexpr tensor_expression(tensor_expression&&) noexcept = default; explicit tensor_expression() = default; @@ -184,18 +184,18 @@ struct binary_tensor_expression [[nodiscard]] inline constexpr decltype(auto) operator()(size_type i) const { return op(left_expr()(i), right_expr()(i)); } -/** - * @brief This is the only way to discourage the users from using `std::move` on the local - * expression because it works differently from the standard way to move the objects. This weird - * behaviour is due to `const reference`, which is impossible to move without constructing a new object. - * If the variable goes out of the scope, stored as a `const reference` inside the expression, - * it will be destroyed that will result in a dangling pointer. But this behaviour is helpful - * for the construction of an expression because the expression might contain a `const reference` - * object that will be passed around as a `const reference` rather than a copy, and we do not need to - * construct a whole new chunky object because, under the hood, we are just passing pointers around. - * - */ protected: + /** + * @brief This is the only way to discourage the users from using `std::move` on the local + * expression because it works differently from the standard way to move the objects. This weird + * behaviour is due to `const reference`, which is impossible to move without constructing a new object. + * If the variable goes out of the scope, stored as a `const reference` inside the expression, + * it will be destroyed that will result in a dangling pointer. But this behaviour is helpful + * for the construction of an expression because the expression might contain a `const reference` + * object that will be passed around as a `const reference` rather than a copy, and we do not need to + * construct a whole new chunky object because, under the hood, we are just passing pointers around. + * + */ constexpr binary_tensor_expression(binary_tensor_expression&& l) noexcept = default; /// @brief This the only way to access the protected move constructor of other expressions. @@ -257,18 +257,18 @@ struct unary_tensor_expression [[nodiscard]] inline constexpr decltype(auto) operator()(size_type i) const { return op(expr()(i)); } -/** - * @brief This is the only way to discourage the users from using `std::move` on the local - * expression because it works differently from the standard way to move the objects. This weird - * behaviour is due to `const reference`, which is impossible to move without constructing a new object. - * If the variable goes out of the scope, stored as a `const reference` inside the expression, - * it will be destroyed that will result in a dangling pointer. But this behaviour is helpful - * for the construction of an expression because the expression might contain a `const reference` - * object that will be passed around as a `const reference` rather than a copy, and we do not need to - * construct a whole new chunky object because, under the hood, we are just passing pointers around. - * - */ protected: + /** + * @brief This is the only way to discourage the users from using `std::move` on the local + * expression because it works differently from the standard way to move the objects. This weird + * behaviour is due to `const reference`, which is impossible to move without constructing a new object. + * If the variable goes out of the scope, stored as a `const reference` inside the expression, + * it will be destroyed that will result in a dangling pointer. But this behaviour is helpful + * for the construction of an expression because the expression might contain a `const reference` + * object that will be passed around as a `const reference` rather than a copy, and we do not need to + * construct a whole new chunky object because, under the hood, we are just passing pointers around. + * + */ constexpr unary_tensor_expression(unary_tensor_expression&& l) noexcept = default; /// @brief This the only way to access the protected move constructor of other expressions.