On Mon, 13 Jan 2014, John Peterson wrote:

Is there anything in C++11 that can be treated analogously to the
"LIBMESH_BEST_UNORDERED_MAP" business we've got now?  That's
actually been pretty useful in the past.

Very good point.  LIBMESH_BEST_UNORDERED_MAP *is* a C++11 feature,
isn't it?  Even though we do have a bunch of fallbacks to TR1 and GNU
implementations.

Off the top of my head, the C++11 features I'd really like to use
(auto, range-based for loop syntax, lambdas) don't really lend
themselves to preprocessor detection/macros like this.

Nope.

But what about easing in to the C++11 world with the new
static_assert?  We can use configure to see if the compiler supports
it, and then have a libmesh_static_assert that either uses it or
falls back on libmesh_assert as the case may be.

Actually, it's easy to implement a limited static_assert in C++03;
we'd just want to do what we did with AutoPtr so we'd get better error
messages when the standard implementation is available.

Hmmm... there's basically three kinds of C++11 features we can use
with old compilers:

Reimplementable-if-not-found features:
  hash tables (done!)
  static_assert
  is_foo type traits
  tuples (within limitations)
  shared_ptr
  unique_ptr

Ignorable-via-preprocessor-if-not-found features:
  constexpr
  final
  override
  rvalue reference argument function overloads
  explicit keyword on conversion operators

Fallback-if-not-found features:
  strongly typed enumerations
  multithreading
  deleted member functions

At the very least, this would force us to start a c++11.m4 file of
some kind to test for specific features, which I don't think we have
at the moment...

I've got a catch-all we can use; we'll probably want to have
feature-by-feature tests, though.
---
Roy
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to