/usr/include/dune/common/conditional.hh is in libdune-common-dev 2.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #ifndef DUNE_COMMON_CONDITIONAL_HH
#define DUNE_COMMON_CONDITIONAL_HH
namespace Dune
{
/** \brief conditional evaluate
sometimes call immediate if, evaluates to
\code
if (b)
return v1;
else
return v2;
\endcode
In contrast to if-then-else the cond function can also be
evaluated for vector valued SIMD data types, see simd.hh.
\param b boolean value
\param v1 value of b==true
\param v2 value of b==false
*/
template<typename T1, typename T2>
const T1 cond(bool b, const T1 & v1, const T2 & v2)
{
return (b ? v1 : v2);
}
} // end namespace Dune
#endif // DUNE_COMMON_CONDITIONAL_HH
|