DUNE PDELab (git)

functional.hh
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set ts=8 sw=2 et sts=2:
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5#ifndef DUNE_COMMON_STD_FUNCTIONAL_HH
6#define DUNE_COMMON_STD_FUNCTIONAL_HH
7
8#include <functional>
9
10#include <dune-common-config.hh> // DUNE_HAVE_CXX_STD_IDENTITY
11
12namespace Dune
13{
14
15 namespace Std
16 {
17
24#if DUNE_HAVE_CXX_STD_IDENTITY
25 using std::identity;
26#else //DUNE_HAVE_CXX_STD_IDENTITY
27 struct identity {
28 template<class T>
29 constexpr T&& operator()(T&& t ) const noexcept {return std::forward<T>(t);}
30 };
31#endif
32 } // namespace Std
33
34} // namespace Dune
35
36#endif // #ifndef DUNE_COMMON_STD_FUNCTIONAL_HH
Dune namespace.
Definition: alignedallocator.hh:13
A function object type whose operator() returns its argument unchanged.
Definition: functional.hh:27
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)