4#ifndef TETL_LINALG_CONJUGATED_SCALAR_HPP
5#define TETL_LINALG_CONJUGATED_SCALAR_HPP
7#include <etl/_concepts/same_as.hpp>
8#include <etl/_linalg/concepts.hpp>
9#include <etl/_linalg/proxy_reference.hpp>
10#include <etl/_type_traits/declval.hpp>
14template <
typename ReferenceValue>
15concept conjugatable =
requires {
16 { conj_if_needed(declval<ReferenceValue>()) } -> same_as<ReferenceValue>;
19template <
typename Reference, conjugatable ReferenceValue>
20struct conjugated_scalar : proxy_reference<Reference, ReferenceValue, conjugated_scalar<Reference, ReferenceValue>> {
21 using value_type =
decltype(conj_if_needed(ReferenceValue(declval<Reference>())));
23 constexpr explicit conjugated_scalar(Reference reference)
24 : base_type(reference)
28 [[nodiscard]]
static constexpr auto to_value(Reference reference)
30 return conj_if_needed(ReferenceValue(reference));
34 using my_type = conjugated_scalar<Reference, ReferenceValue>;
35 using base_type = proxy_reference<Reference, ReferenceValue, my_type>;
Definition accessor_conjugate.hpp:13
Definition adjacent_find.hpp:9