dune-common  2.11
Classes | Namespaces | Functions | Variables
hybridutilities.hh File Reference
#include <tuple>
#include <utility>
#include <dune/common/typetraits.hh>
#include <dune/common/typeutilities.hh>
#include <dune/common/fvector.hh>
#include <dune/common/indices.hh>
#include <dune/common/integersequence.hh>
#include <dune/common/rangeutilities.hh>

Go to the source code of this file.

Classes

class  Dune::Hybrid::HybridFunctor< Functor >
 Adapter of a hybrid functor that maintains results hybrid. More...
 

Namespaces

 Dune
 Dune namespace
 
 Dune::Hybrid
 Namespace with loops, conditionals and other constructs that can handle both compile-time and run-time conditions.
 

Functions

template<class T >
constexpr auto Dune::Hybrid::size (const T &t)
 Size query. More...
 
template<class Container , class Index >
decltype(auto) constexpr Dune::Hybrid::elementAt (Container &&c, Index &&i)
 Get element at given position from container. More...
 
template<class Begin , class End >
constexpr auto Dune::Hybrid::integralRange (const Begin &begin, const End &end)
 Create an integral range. More...
 
template<class End >
constexpr auto Dune::Hybrid::integralRange (const End &end)
 Create an integral range starting from 0. More...
 
template<class Range , class F >
constexpr void Dune::Hybrid::forEach (Range &&range, F &&f)
 Range based for loop. More...
 
template<class Range , class T , class F >
constexpr T Dune::Hybrid::accumulate (Range &&range, T value, F &&f)
 Accumulate values. More...
 
template<class Condition , class IfFunc , class ElseFunc >
decltype(auto) Dune::Hybrid::ifElse (const Condition &condition, IfFunc &&ifFunc, ElseFunc &&elseFunc)
 A conditional expression. More...
 
template<class Condition , class IfFunc >
void Dune::Hybrid::ifElse (const Condition &condition, IfFunc &&ifFunc)
 A conditional expression. More...
 
template<class Functor >
constexpr HybridFunctor< Functor > Dune::Hybrid::hybridFunctor (const Functor &)
 Returns an HybridFunctor adaptor. More...
 
template<class Cases , class Value , class Branches , class ElseBranch >
decltype(auto) constexpr Dune::Hybrid::switchCases (const Cases &cases, const Value &value, Branches &&branches, ElseBranch &&elseBranch)
 Switch statement. More...
 
template<class Cases , class Value , class Branches >
constexpr void Dune::Hybrid::switchCases (const Cases &cases, const Value &value, Branches &&branches)
 Switch statement. More...
 
template<class T , class Value , class Branches >
constexpr void Dune::Hybrid::switchCases (IntegralRange< T > range, const Value &value, Branches &&branches)
 Switch statement. More...
 

Variables

constexpr auto Dune::Hybrid::max = hybridFunctor(Impl::Max{})
 Function object that returns the greater of the given values. More...
 
constexpr auto Dune::Hybrid::min = hybridFunctor(Impl::Min{})
 Function object that returns the smaller of the given values. More...
 
constexpr auto Dune::Hybrid::plus = hybridFunctor(std::plus<>{})
 Function object for performing addition. More...
 
constexpr auto Dune::Hybrid::minus = hybridFunctor(std::minus<>{})
 Function object for performing subtraction. More...
 
constexpr auto Dune::Hybrid::equal_to = hybridFunctor(std::equal_to<>{})
 Function object for performing equality comparison. More...