[PPL-devel] [GIT] ppl/ppl(master): Avoid needless macro complexity.

Abramo Bagnara abramo.bagnara at gmail.com
Wed Mar 14 11:35:03 CET 2012


Module: ppl/ppl
Branch: master
Commit: f3442f48f028d6e94df0246c9ad23d9c43feaf43
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=f3442f48f028d6e94df0246c9ad23d9c43feaf43

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Wed Mar 14 11:34:58 2012 +0100

Avoid needless macro complexity.

---

 src/Checked_Number.inlines.hh |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/Checked_Number.inlines.hh b/src/Checked_Number.inlines.hh
index 767b810..ba8b841 100644
--- a/src/Checked_Number.inlines.hh
+++ b/src/Checked_Number.inlines.hh
@@ -131,11 +131,6 @@ Checked_Number<T, Policy>::Checked_Number(const type x) {		\
 		  dir));						\
 }
 
-#define PPL_COND_0(...)
-#define PPL_COND_1(...) __VA_ARGS__
-#define PPL_COND_(if, ...) PPL_COND_##if(__VA_ARGS__)
-#define PPL_COND(if, ...) PPL_COND_(if, __VA_ARGS__)
-
 PPL_DEFINE_CTOR(char)
 PPL_DEFINE_CTOR(signed char)
 PPL_DEFINE_CTOR(signed short)
@@ -147,18 +142,20 @@ PPL_DEFINE_CTOR(unsigned short)
 PPL_DEFINE_CTOR(unsigned int)
 PPL_DEFINE_CTOR(unsigned long)
 PPL_DEFINE_CTOR(unsigned long long)
-PPL_COND(PPL_SUPPORTED_FLOAT, PPL_DEFINE_CTOR(float))
-PPL_COND(PPL_SUPPORTED_DOUBLE, PPL_DEFINE_CTOR(double))
-PPL_COND(PPL_SUPPORTED_LONG_DOUBLE, PPL_DEFINE_CTOR(long double))
+#if PPL_SUPPORTED_FLOAT
+PPL_DEFINE_CTOR(float)
+#endif
+#if PPL_SUPPORTED_DOUBLE
+PPL_DEFINE_CTOR(double)
+#endif
+#if PPL_SUPPORTED_LONG_DOUBLE
+PPL_DEFINE_CTOR(long double)
+#endif
 PPL_DEFINE_CTOR(mpq_class&)
 PPL_DEFINE_CTOR(mpz_class&)
 
 #undef PPL_DEFINE_CTOR
 
-#undef PPL_COND
-#undef PPL_COND_
-#undef PPL_COND_1
-#undef PPL_COND_0
 
 template <typename T, typename Policy>
 inline




More information about the PPL-devel mailing list