Skip to content

Commit

Permalink
Cleanup convertible_expr concept
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Dec 10, 2023
1 parent ebb065e commit 54a37d6
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions include/etl/adapters/diagonal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct diagonal_matrix final : adapter<Matrix>, iterable<const diagonal_matrix<M
* \param e The ETL expression to get the values from
* \return a reference to the fast matrix
*/
template <typename E>
diagonal_matrix& operator=(E&& e) noexcept(false) requires convertible_expr<E, value_type> {
template <convertible_expr<value_type> E>
diagonal_matrix& operator=(E&& e) noexcept(false) {
// Make sure the other matrix is diagonal
if (!is_diagonal(e)) {
throw diagonal_exception();
Expand Down
4 changes: 2 additions & 2 deletions include/etl/adapters/hermitian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ struct hermitian_matrix final : adapter<Matrix>, iterable<const hermitian_matrix
* \param e The ETL expression to get the values from
* \return a reference to the fast matrix
*/
template <typename E>
hermitian_matrix& operator=(E&& e) noexcept(false) requires convertible_expr<E, value_type> {
template <convertible_expr<value_type> E>
hermitian_matrix& operator=(E&& e) noexcept(false) {
// Make sure the other matrix is hermitian
if (!is_hermitian(e)) {
throw hermitian_exception();
Expand Down
4 changes: 2 additions & 2 deletions include/etl/adapters/lower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct lower_matrix final : adapter<Matrix>, iterable<const lower_matrix<Matrix>
* \param e The ETL expression to get the values from
* \return a reference to the fast matrix
*/
template <typename E>
lower_matrix& operator=(E&& e) noexcept(false) requires convertible_expr<E, value_type> {
template <convertible_expr<value_type> E>
lower_matrix& operator=(E&& e) noexcept(false) {
// Make sure the other matrix is lower triangular
if (!is_lower_triangular(e)) {
throw lower_exception();
Expand Down
4 changes: 2 additions & 2 deletions include/etl/adapters/strictly_lower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ struct strictly_lower_matrix final : adapter<Matrix>, iterable<const strictly_lo
* \param e The ETL expression to get the values from
* \return a reference to the fast matrix
*/
template <typename E>
strictly_lower_matrix& operator=(E&& e) noexcept(false) requires convertible_expr<E, value_type>{
template <convertible_expr<value_type> E>
strictly_lower_matrix& operator=(E&& e) noexcept(false) {
// Make sure the other matrix is strictly lower triangular
if (!is_strictly_lower_triangular(e)) {
throw strictly_lower_exception();
Expand Down
4 changes: 2 additions & 2 deletions include/etl/adapters/strictly_upper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct strictly_upper_matrix final : adapter<Matrix>, iterable<const strictly_up
* \param e The ETL expression to get the values from
* \return a reference to the fast matrix
*/
template<typename E>
strictly_upper_matrix& operator=(E&& e) noexcept(false) requires convertible_expr<E, value_type> {
template<convertible_expr<value_type> E>
strictly_upper_matrix& operator=(E&& e) noexcept(false) {
// Make sure the other matrix is strictly upper triangular
if (!is_strictly_upper_triangular(e)) {
throw strictly_upper_exception();
Expand Down
4 changes: 2 additions & 2 deletions include/etl/adapters/symmetric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ struct symmetric_matrix final : adapter<Matrix>, iterable<const symmetric_matrix
* \param e The ETL expression to get the values from
* \return a reference to the fast matrix
*/
template <typename E>
symmetric_matrix& operator=(E&& e) noexcept(false) requires convertible_expr<E, value_type> {
template <convertible_expr<value_type> E>
symmetric_matrix& operator=(E&& e) noexcept(false) {
// Make sure the other matrix is symmetric
if (!is_symmetric(e)) {
throw symmetric_exception();
Expand Down
4 changes: 2 additions & 2 deletions include/etl/adapters/uni_upper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ struct uni_upper_matrix final : adapter<Matrix>, iterable<const uni_upper_matrix
* \param e The ETL expression to get the values from
* \return a reference to the fast matrix
*/
template <typename E>
uni_upper_matrix& operator=(E&& e) noexcept(false) requires convertible_expr<E, value_type> {
template <convertible_expr<value_type> E>
uni_upper_matrix& operator=(E&& e) noexcept(false) {
// Make sure the other matrix is uni upper triangular
if (!is_uni_upper_triangular(e)) {
throw uni_upper_exception();
Expand Down
4 changes: 2 additions & 2 deletions include/etl/adapters/upper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct upper_matrix final : adapter<Matrix>, iterable<const upper_matrix<Matrix>
* \param e The ETL expression to get the values from
* \return a reference to the fast matrix
*/
template <typename E>
upper_matrix& operator=(E&& e) noexcept(false) requires convertible_expr<E, value_type> {
template <convertible_expr<value_type> E>
upper_matrix& operator=(E&& e) noexcept(false) {
// Make sure the other matrix is upper triangular
if (!is_upper_triangular(e)) {
throw upper_exception();
Expand Down
2 changes: 1 addition & 1 deletion include/etl/concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ concept matrix = etl_expr<T> && decay_traits<T>::dimensions() > 1;
template <typename T>
concept fast_matrix_c = fast<T> && matrix<T>;

template <typename E, typename T>
template <typename T, typename E>
concept same_dimensions = etl_expr<T> && decay_traits<T>::dimensions() == decay_traits<E>::dimensions();

template <typename T>
Expand Down

0 comments on commit 54a37d6

Please sign in to comment.