dune-common  2.7.0
functional.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 #ifndef DUNE_COMMON_STD_FUNCTIONAL_HH
4 #define DUNE_COMMON_STD_FUNCTIONAL_HH
5 
6 #include <functional>
7 
8 namespace Dune
9 {
10 
11  namespace Std
12  {
13 
20 #if DUNE_HAVE_CXX_STD_IDENTITY
21  using std::identity;
22 #else //DUNE_HAVE_CXX_STD_IDENTITY
23  struct identity {
24  template<class T>
25  constexpr T&& operator()(T&& t ) const noexcept {return std::forward<T>(t);}
26  };
27 #endif
28  } // namespace Std
29 
30 } // namespace Dune
31 
32 #endif // #ifndef DUNE_COMMON_STD_FUNCTIONAL_HH
Dune::Std::identity
A function object type whose operator() returns its argument unchanged.
Definition: functional.hh:23
Dune::Std::identity::operator()
constexpr T && operator()(T &&t) const noexcept
Definition: functional.hh:25
Dune
Dune namespace.
Definition: alignedallocator.hh:13