#ifndef BANDIT_COLORED_REPORTER_H
#define BANDIT_COLORED_REPORTER_H

#include <ostream>
#include <bandit/reporters/colorizer.h>
#include <bandit/reporters/progress_reporter.h>

namespace bandit { namespace detail {

  struct colored_reporter : public progress_reporter
  {
    colored_reporter(std::ostream& stm,
        const failure_formatter& failure_formatter,
        const colorizer& colorizer)
      : progress_reporter(failure_formatter), stm_(stm), colorizer_(colorizer)
    {}

  protected:
    std::ostream& stm_;
    const detail::colorizer& colorizer_;
  };

}}

#endif

#ifndef BANDIT_COLORED_REPORTER_H
#define BANDIT_COLORED_REPORTER_H

#include <ostream>
#include <bandit/reporters/colorizer.h>
#include <bandit/reporters/progress_reporter.h>

namespace bandit { namespace detail {

  struct colored_reporter : public progress_reporter
  {
    colored_reporter(std::ostream& stm,
        const failure_formatter& failure_formatter,
        const colorizer& colorizer)
      : progress_reporter(failure_formatter), stm_(stm), colorizer_(colorizer)
    {}

    virtual ~colored_reporter()
    {
      stm_ << colorizer_.reset();
    }

  protected:
    std::ostream& stm_;
    const detail::colorizer& colorizer_;
  };

}}

#endif

Make sure the colorizer is reset
Make sure the colorizer is reset

This is done using the colored_reporter destructor.

This should fix the part of #90, i.e., that colors are changed when the
code exits unexpectedly, or in case the reporter simply does not reset
the colorizer.
