3.3.0
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Classes | Namespaces | Functions | Variables
tag.hh File Reference

Helper class to create (named and comparable) tagged types. More...

#include <sstream>
#include <ostream>
#include <type_traits>
#include <dune/common/classname.hh>
#include <dumux/common/typetraits/isvalid.hh>

Go to the source code of this file.

Description

Helper class to create (named and comparable) tagged types.

Classes

struct  Dumux::Utility::Tag< T >
 Helper class to create (named and comparable) tagged types Tags any given type. The tagged type is equality comparable and can be written to streams. A custom name can be provided by implementing the name() member function. More...
 

Namespaces

namespace  Dumux
 
namespace  Dumux::Utility
 
namespace  Dumux::Utility::Detail
 

Functions

template<class T1 , class T2 >
constexpr bool Dumux::Utility::operator== (Tag< T1 >, Tag< T2 >)
 Tags are equality comparable and return true if the tagged types are equal. More...
 
template<class T1 , class T2 >
constexpr bool Dumux::Utility::operator!= (Tag< T1 >, Tag< T2 >)
 
template<class T , std::enable_if_t< std::is_base_of_v< Tag< T >, T >, int > = 0>
auto Dumux::Utility::operator<< (std::ostream &os, const T &t) -> std::enable_if_t< decltype(Detail::hasName(t))::value, std::ostream & >
 Return the class name of the tagged type calling t.name() More...
 

Variables

constexpr auto Dumux::Utility::Detail::hasName = isValid([](auto&& t) -> decltype(t.name(), void()) {})
 
Include dependency graph for tag.hh: