summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2019-07-04 22:47:36 +0200
committerWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2019-07-04 22:47:36 +0200
commitc3acd51557d6c1d41565acaab2966b193d573230 (patch)
tree6af77d4637175149b56b726a599511985e42ee7a
parent47d2c53cbdb8c03a793d54324eb0b0a127c73a4a (diff)
downloaddwu-c3acd51557d6c1d41565acaab2966b193d573230.tar.gz
dwu-c3acd51557d6c1d41565acaab2966b193d573230.tar.bz2
a little bit of formatting and undefining helper macro once done
-rw-r--r--include/dwu/operators7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/dwu/operators b/include/dwu/operators
index e9315fc..7100301 100644
--- a/include/dwu/operators
+++ b/include/dwu/operators
@@ -28,7 +28,7 @@
namespace dwu { namespace operators {
#define DWU_OPERATOR(O) \
template<template<typename,typename> class C, typename Tl, typename A, typename Tr> \
-C<Tl,A> operator O (C<Tl,A> const&l, Tr const &r) { \
+C<Tl,A> operator O (C<Tl,A> const &l, Tr const &r) { \
C<Tl,A> v(l.size()); \
auto vi = v.begin(); auto li = l.begin(); \
while( vi != v.end() ){ \
@@ -55,12 +55,12 @@ Cl<Tl,Al> operator O (Cl<Tl,Al> const &l, Cr<Tr,Ar> const &r) { \
return v; \
} \
template<template<typename,typename> class C, typename Tl, typename A, typename Tr> \
-C<Tl,A>& operator O##= (C<Tl,A> &l, Tr const& r){ \
+C<Tl,A>& operator O##= (C<Tl,A> &l, Tr const &r){ \
for(auto &x:l){ x O##= r; } \
return l; \
} \
template<template<typename,typename> class Cl, template<typename,typename> class Cr, typename Tl, typename Al, typename Tr, typename Ar> \
-Cl<Tl,Al>& operator O##= (Cl<Tl,Al> &l, Cr<Tr,Ar> const& r){ \
+Cl<Tl,Al>& operator O##= (Cl<Tl,Al> &l, Cr<Tr,Ar> const &r){ \
auto li = l.begin(); auto ri = r.begin(); \
while( li != l.end() && ri != r.end() ){ \
*li++ O##= *ri++; \
@@ -76,4 +76,5 @@ DWU_OPERATOR(^)
DWU_OPERATOR(&)
DWU_OPERATOR(|)
} }
+#undef DWU_OPERATOR
#endif/*DWU__OPERATORS__*/