version 3.11-dev
Loading...
Searching...
No Matches
deprecated.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12
13#ifndef DUMUX_COMMON_DEPRECATED_HH
14#define DUMUX_COMMON_DEPRECATED_HH
15
16#include <utility>
17
18#include <dune/common/ftraits.hh>
19#include <dune/common/exceptions.hh>
20#include <dune/common/std/type_traits.hh>
22
23namespace Dumux {
24
25#ifndef DOXYGEN // hide from doxygen
26// Helper classes/functions for deprecation
27// Each implementation has to state after which release
28// it will be removed. Implementations in the Deprecated
29// namespace will be removed without
30// deprecation after their usage in the code expired,
31// so most likely you don't want to use this in your code
32namespace Deprecated {
33
34#ifdef __clang__
35#pragma clang diagnostic push
36#pragma clang diagnostic ignored "-Wdeprecated-declarations"
37#endif // __clang__
38
43template<class T>
44decltype(auto) gridGeometry(const T& t)
45{
46 if constexpr (requires { t.gridDiscretization(); })
47 return t.gridDiscretization();
48 else
49 return t.gridGeometry();
50}
51
52#ifdef __clang__
53#pragma clang diagnostic pop
54#endif // __clang__
55
56
57} // end namespace Deprecated
58#endif
59
60} // end namespace Dune
61#endif
Definition adapt.hh:17
A helper to deduce a vector with the same size as numbers of equations.