Introduction

Using Hippo

Hippo is a header-only library, so install the headers however you’d like.

To begin using Hippo, include the following:

#include "hippo/hippo.h"

Printing a value

Printing values is performed by the hippo::print() or hippo::print_to() functions. Both functions take a value and a hippo::configuration and produce a pretty-printed output.

A simple example of printing a vector:

#include "hippo/hippo.h"
#include "hippo/std/vector.h"
#include <iostream>

int main() {
  std::vector<int> v {0, 1, 2};
  hippo::print_to(std::cout, v, hippo::configuration());
}

This example will print:

std::vector [0, 1, 2]

Interface

struct configuration

Global configuration values applied to all printers.

Public Members

std::uint64_t indent

The number of spaces to indent for each indentation level (defaults to 0)

std::uint64_t width

The number of output columns, not a hard limit but best-effort (defaults to 60)

template<typename T>
std::vector<std::string> hippo::print(const T &t, const hippo::configuration &config)

Print any printable value t with configuration config

template<typename T>
std::ostream &hippo::print_to(std::ostream &os, const T &t, const hippo::configuration &config)

Print any printable value t with configuration config to the specified std::ostream