aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-06-08 11:50:49 -0400
committerErik Schnetter <schnetter@gmail.com>2013-06-08 11:50:49 -0400
commitd72f38ca4a92993314000f905358f7163517d695 (patch)
tree319833680d964e8866884c6fd0e71f5e0e75dc37 /Carpet/CarpetLib
parent3554187cb190c2c7035e3bfe1d3b99bda1ab8301 (diff)
CarpetLib: Provide manual look-alikes for certain C++11 features
Provide "forall" based on Boost's FOREACH. Provide shared_ptr based on Boost's shared_ptr.
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r--Carpet/CarpetLib/src/defs.hh20
1 files changed, 20 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/defs.hh b/Carpet/CarpetLib/src/defs.hh
index 398057d4d..747761cd7 100644
--- a/Carpet/CarpetLib/src/defs.hh
+++ b/Carpet/CarpetLib/src/defs.hh
@@ -21,6 +21,26 @@
using namespace std;
+// TODO: autoconf these
+
+#ifdef CARPET_USE_BOOST_FOREACH
+# include <boost/foreach.hpp>
+// We call the macro "forall", not "foreach", since the name "foreach"
+// is taken by Boost and cannot be used here. An alternative name
+// would be "foreach_" with a trailing underscore.
+# define forall BOOST_FOREACH
+// # define forall_r BOOST_REVERSE_FOREACH
+#else
+# define forall(var, expr) for (var: expr)
+#endif
+
+#ifdef CARPET_USE_BOOST_SHARED_PTR
+# include <boost/shared_ptr.hpp>
+# include <boost/make_shared.hpp>
+# define shared_ptr boost::shared_ptr
+# define make_shared boost::make_shared
+#endif
+
// Stringify