UgMisc 0.3
Miscellaneous C++ header library
Loading...
Searching...
No Matches
samples_output.hpp File Reference
#include <iostream>
#include <utility>
#include <type_traits>

Go to the source code of this file.

Classes

class  SampleOutput< OS, Target >

Enumerations

enum  SampleOutputTarget {
  SAMPLE_NORMAL_OUTPUT = 1 , SAMPLE_TEST_OUTPUT = 2 , SAMPLE_ALWAYS_OUTPUT = 3 , SAMPLE_ACTIVE_OUTPUT = SAMPLE_NORMAL_OUTPUT ,
  SAMPLE_DEFAULT_OUTPUT = SAMPLE_NORMAL_OUTPUT
}

Functions

template<typename T = std::ostream>
 SampleOutput () -> SampleOutput< T >
template<typename T>
 SampleOutput (T &) -> SampleOutput< T >
template<typename T, SampleOutputTarget Tgt>
 SampleOutput (SampleOutput< T, Tgt >) -> SampleOutput< T >

Detailed Description

Sample programs use the SampleOutput class template to print their actual output (in a normal build) and their expected output (in a special test build).

out.always() << "Getting Foo result:\n";
out << getFooResult();
out.expected() << "Result: foo = false\n";
out.always << "Writing story:\n";
writeStory(out);
out.expected() << "Once there was a little sausage called Baldrick.\n";

Definition in file samples_output.hpp.

Enumeration Type Documentation

◆ SampleOutputTarget

enum SampleOutputTarget

Definition at line 32 of file samples_output.hpp.

Function Documentation

◆ SampleOutput()

template<typename T = std::ostream>
SampleOutput ( ) -> SampleOutput< T >

Definition at line 131 of file samples_output.hpp.