23namespace vctr::expressions
26template <
size_t extent,
class SrcType, std::constructible_from<ValueType<SrcType>> DstValueType>
30 using value_type = DstValueType;
34 VCTR_FORCEDINLINE
constexpr DstValueType operator[] (
size_t i)
const
36 return static_cast<DstValueType
> (src[i]);
39 VCTR_FORCEDINLINE
const DstValueType* evalNextVectorOpInExpressionChain (DstValueType* dst)
const
43 std::is_trivially_constructible_v<DstValueType>
48 const auto* s = src.evalNextVectorOpInExpressionChain (
static_cast<ValueType<SrcType>*
> (
static_cast<void*
> (dst)));
50 const auto n = src.size();
51 for (
size_t i = 0; i < n; ++i)
52 dst[i] =
static_cast<DstValueType
> (s[i]);
66template <
class DstType>
Constrains a type to have a member function evalNextVectorOpInExpressionChain (value_type*) const.
Definition: ContainerAndExpressionConcepts.h:94
Constrains a type to be any derived instance of VctrBase.
Definition: ContainerAndExpressionConcepts.h:192
constexpr ExpressionChainBuilder< expressions::TransformedByStaticCast, DstType > transformedByStaticCastTo
Transforms all source elements to DstValueType by applying a static_cast<DstValueType> to them.
Definition: TransformedByStaticCast.h:67
The main namespace of the VCTR project.
Definition: Array.h:24
typename detail::ValueType< std::remove_cvref_t< T > >::Type ValueType
If T is an expression template, it equals its return type, if it's a type that defines value_type as ...
Definition: Traits.h:201
An expression chain builder is an object which supplies various operator<< overloads which build chai...
Definition: ExpressionChainBuilder.h:136
The base class to every expression template.
Definition: ExpressionTemplate.h:37