version 3.7
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-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
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
39#ifdef __clang__
40#pragma clang diagnostic pop
41#endif // __clang__
42
43template<class CO2Impl>
44 struct BrineCO2Helper{
45 template<class CO2Arg>
46 using TabulatedDensityDetector = decltype(std::declval<CO2Arg>().tabulatedDensity);
47 static constexpr bool rawCO2Table = Dune::Std::is_detected<TabulatedDensityDetector,
48 CO2Impl >::value;
49
50 template< typename T>
51 [[deprecated("Passing just CO2Tables to define a BrineCO2 fluidsystem/binarycoefficient is deprecated. Use Components::CO2<Scalar, CO2Tables> as template parameter instead.")]]
52 static constexpr void DefiningBrineCO2WithCO2Table() {}
53
54 static constexpr bool isRawTable()
55 {
56 if constexpr (rawCO2Table)
57 DefiningBrineCO2WithCO2Table<CO2Impl>();
58 return rawCO2Table;
59 }
60 };
61
62} // end namespace Deprecated
63#endif
64
65} // end namespace Dune
66#endif
Definition: adapt.hh:17
A helper to deduce a vector with the same size as numbers of equations.