1#ifndef __DUNE_ACFEM_COMMON_OSTREAM_HH__
2#define __DUNE_ACFEM_COMMON_OSTREAM_HH__
13#include <dune/common/hybridutilities.hh>
14#include <dune/common/streamoperators.hh>
18#include "typestring.hh"
19#include "../mpl/mpl.hh"
21#include "fractionconstant.hh"
31 template<class T, std::size_t Size = std::numeric_limits<T>::digits>
32 auto makeBitset(
const T& t,
const IndexConstant<Size>& = IndexConstant<Size>{})
34 return std::bitset<Size>(t);
41 return out << t.name(
true);
54 void prettyPrint(T&& arg, std::ostream& out = std::cout,
const bool newLine =
true)
70 template<
class T, std::enable_if_t<(IsTupleLike<T>::value
74 std::ostream&
operator<<(std::ostream& out,
const T& t)
76 out << (IsArray<T>::value ?
"[" :
"(");
77 forLoop<size<T>()>([&] (
auto i) {
78 using I =
decltype(i);
79 out << std::get<I::value>(t);
80 if (I::value < size<T>()-1) {
84 out << (IsArray<T>::value ?
"]" :
")");
89 template<
class Int, Int I0, Int... I>
92 return ((out <<
"<" << I0) << ... << (
"," + toString(I))) <<
">";
96 std::ostream&
operator<<(std::ostream& out, Sequence<Int>)
102 template<
bool I0,
bool... I>
105 return ((out << (I0 ?
"true" :
"false")) << ... << (I ?
" true" :
" false"));
108 static inline std::ostream&
operator<<(std::ostream& out, BoolSequence<>)
113 using Dune::operator<<;
114 using Dune::ACFem::operator<<;
A class constructing the name of another type.
Definition: typestring.hh:67
void prettyPrint(T &&arg, std::ostream &out=std::cout, const bool newLine=true)
Print something which shows the type that was passed to the function.
Definition: ostream.hh:54
std::ostream & operator<<(std::ostream &out, TypeString< T > &&t)
Output operator for TypePrint tag-structure.
Definition: ostream.hh:39
auto typeString(T &&t, bool stripNameSpaces=true)
Generator for TypeString.
Definition: typestring.hh:144
std::integer_sequence< T, V... > Sequence
Sequence of any type of integer values.
Definition: types.hh:56
Sequence< bool, Decisions... > BoolSequence
Sequence of boolean values.
Definition: types.hh:60