dune-common  2.9.0
conditional.hh
Go to the documentation of this file.
1 // SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3 #ifndef DUNE_COMMON_CONDITIONAL_HH
4 #define DUNE_COMMON_CONDITIONAL_HH
5 
6 namespace Dune
7 {
8 
27  template<typename T1, typename T2>
28  const T1 cond(bool b, const T1 & v1, const T2 & v2)
29  {
30  return (b ? v1 : v2);
31  }
32 
33 } // end namespace Dune
34 
35 #endif // DUNE_COMMON_CONDITIONAL_HH
Dune namespace.
Definition: alignedallocator.hh:13
const T1 cond(bool b, const T1 &v1, const T2 &v2)
conditional evaluate
Definition: conditional.hh:28