summaryrefslogtreecommitdiff
path: root/src/array_fun.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-04 03:04:50 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-04 03:04:50 +0900
commitb4ae03970266351f3b024a30df88205aacf7d225 (patch)
treef474c5ef791cdc6cdfbd35ca11a86d57315947d2 /src/array_fun.h
parent05d75ed21826ec699083836bc32bd6e14ae1ac87 (diff)
BinExpr, UnExpr: Make copies of args so that we can use them with rvalues
Diffstat (limited to 'src/array_fun.h')
-rw-r--r--src/array_fun.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/array_fun.h b/src/array_fun.h
index b8054c36..c59ebc17 100644
--- a/src/array_fun.h
+++ b/src/array_fun.h
@@ -82,7 +82,7 @@ namespace expr {
template<typename L, typename OpTag, typename R>
struct BinExpr {
- BinExpr(const L& l, const R& r):l_(l), r_(r) {}
+ BinExpr(L l, R r):l_(l), r_(r) {}
typedef typename OpTag::returnType returnType;
@@ -91,13 +91,13 @@ struct BinExpr {
return OpTag::apply(l_[index], r_[index]);
}
- const L& l_;
- const R& r_;
+ const L l_;
+ const R r_;
};
template<typename OpTag, typename A>
struct UnExpr {
- UnExpr(const A& a):a_(a) {}
+ UnExpr(A a):a_(a) {}
typedef typename OpTag::returnType returnType;
@@ -106,7 +106,7 @@ struct UnExpr {
return OpTag::apply(a_[index]);
}
- const A& a_;
+ const A a_;
};
template<typename T>