dune-pdelab  2.0.0
unordered_set.hh
Go to the documentation of this file.
1 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set ts=8 sw=2 et sts=2:
3 
4 #ifndef DUNE_PDELAB_COMMON_UNORDERED_SET_HH
5 #define DUNE_PDELAB_COMMON_UNORDERED_SET_HH
6 
11 #include <dune/common/static_assert.hh>
12 
13 // Try to find an unordered_set implementation
14 #ifdef HAVE_UNORDERED_SET
15 
16 #include <unordered_set>
17 
18 #elif HAVE_TR1_UNORDERED_SET
19 
20 #include <tr1/unordered_set>
21 
22 #endif
23 
24 namespace Dune {
25  namespace PDELab {
26 
27  // import implementation into Dune::PDELab namespace if there is one.
28 #ifdef HAVE_UNORDERED_SET
29 
30  using std::unordered_set;
31 
32 #elif HAVE_TR1_UNORDERED_SET
33 
34  using std::tr1::unordered_set;
35 
36 #else
37 
38  // Dummy implementations to feed the user an explanation of what went wrong here.
39 
40  template<typename Key,
41  typename Hash = int,
42  typename Pred = int,
43  typename Allocator = int
44  >
46  {
47  dune_static_assert(Dune::AlwaysFalse<Key>::value,"Unable to find implementation for unordered_set.");
48  };
49 
50  template<typename Key,
51  typename Hash = int,
52  typename Pred = int,
53  typename Allocator = int
54  >
56  {
57  dune_static_assert(Dune::AlwaysFalse<Key>::value,"Unable to find implementation for unordered_multiset.");
58  };
59 
60 #endif
61 
62  } // end namespace PDELab
63 } // end namespace Dune
64 
65 #endif // DUNE_PDELAB_COMMON_UNORDERED_SET_HH
Definition: unordered_set.hh:55
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
Definition: unordered_set.hh:45