Utopia 2
Framework for studying models of complex & adaptive systems.
|
#include "type_traits.hh"
Go to the source code of this file.
Namespaces | |
namespace | Utopia |
namespace | Utopia::Utils |
Functions | |
template<typename T , typename U > | |
std::ostream & | Utopia::Utils::operator<< (std::ostream &out, const std::pair< T, U > &pair) |
pretty print a pair | |
template<class T > | |
std::enable_if_t< is_container_v< T >, std::ostream & > | Utopia::Utils::operator<< (std::ostream &out, const T &container) |
std::ostream & | Utopia::Utils::operator<< (std::ostream &out, const std::vector< bool > &container) |
Output container to stream 'out'- specialization for vector of booleans. Note that a vector of booleans is not the same as a vector of any other type because it does some storage optimization to make booleans take up single bits only. | |
template<template< typename, typename, typename... > class MapType, typename Key , typename Value , typename... Args> | |
std::enable_if_t< is_associative_container_v< MapType< Key, Value, Args... > > or is_unordered_associative_container_v< MapType< Key, Value, Args... > >, std::ostream & > | Utopia::Utils::operator<< (std::ostream &out, const MapType< Key, Value, Args... > &map) |
Output (unordered) associative containers to an std::ostream. | |
template<typename... Types> | |
std::ostream & | Utopia::Utils::operator<< (std::ostream &ostr, std::tuple< Types... > tuple) |
Report a tuple to an outstream, This works by piping the single elements inside the tuple to the stream, and therefor requires operator<< for the underlying types to be defined. | |
template<typename T > | |
std::string | Utopia::Utils::str (T &&t) |
Turn any object for which operator<< exists into a string. Mostly useful for logging data via spdlog which for instance cannot log containers per default. | |