Lumiera  0.pre.03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
format-util.hpp File Reference

Go to the source code of this file.


Collection of small helpers and convenience shortcuts for diagnostics & formatting.

  • util::str() performs a failsafe to-String conversion, thereby preferring a built-in conversion operator, falling back to just a mangled type string.
  • util::join() generates an enumerating string from elements of an arbitrary sequence or iterable. Elements will be passed through our generic string conversion
See also
frontend for boost::format, printf-style

Definition in file format-util.hpp.

#include "lib/meta/trait.hpp"
#include "lib/format-obj.hpp"
#include "lib/itertools.hpp"
#include "lib/symbol.hpp"
#include "lib/util.hpp"
#include <string>
#include <sstream>
#include <utility>
#include <typeinfo>


template<class CON >
string join (CON &&coll, string const &delim=", ")
 enumerate a collection's contents, separated by delimiter. More...
template<class X >
string join (std::initializer_list< X > const &&ili, string const &delim=", ")
template<class CON , typename... ELMS>
CON stringify (ELMS const &...elms)
 convert a sequence of elements to string More...
template<class IT >
auto stringify (IT &&src)
 convert to string as transforming step in a pipeline More...