From d72f38ca4a92993314000f905358f7163517d695 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 8 Jun 2013 11:50:49 -0400 Subject: 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. --- Carpet/CarpetLib/src/defs.hh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Carpet/CarpetLib') 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 +// 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 +# include +# define shared_ptr boost::shared_ptr +# define make_shared boost::make_shared +#endif + // Stringify -- cgit v1.2.3