28 #ifndef REMORA_EXPRESSION_TYPE_HPP 29 #define REMORA_EXPRESSION_TYPE_HPP 43 template<
class E,
class Device>
44 struct vector_expression {
45 typedef E expression_type;
46 typedef Device device_type;
47 const expression_type &operator()()
const {
48 return *
static_cast<const expression_type *
>(
this);
51 expression_type &operator()() {
52 return *
static_cast<expression_type *
>(
this);
62 template<
class C,
class Device>
63 struct vector_container:
public vector_expression<C, Device> {
64 typedef C container_type;
66 const container_type &operator()()
const {
67 return *
static_cast<const container_type *
>(
this);
70 container_type &operator()() {
71 return *
static_cast<container_type *
>(
this);
82 template<
class E,
class Device>
83 struct matrix_expression {
84 typedef E expression_type;
85 typedef Device device_type;
87 const expression_type &operator()()
const {
88 return *
static_cast<const expression_type *
>(
this);
91 expression_type &operator()() {
92 return *
static_cast<expression_type *
>(
this);
108 struct vector_set_expression {
109 typedef E expression_type;
111 const expression_type &operator()()
const {
112 return *
static_cast<const expression_type *
>(
this);
115 expression_type &operator()() {
116 return *
static_cast<expression_type *
>(
this);
126 template<
class C,
class Device>
127 struct matrix_container:
public matrix_expression<C, Device> {
128 typedef C container_type;
130 const container_type &operator()()
const {
131 return *
static_cast<const container_type *
>(
this);
134 container_type &operator()() {
135 return *
static_cast<container_type *
>(
this);
140 struct temporary_proxy:
public P{
141 temporary_proxy(P
const& p):P(p){}
144 P& operator=(E
const& e){
145 return static_cast<P&
>(*this) = e;
148 P& operator=(temporary_proxy<P>
const& e){
149 return static_cast<P&
>(*this) = e;