/* * Copyright (c) 2014 Eran Pe'er. * * This program is made available under the terms of the MIT License. * * Created on Mar 10, 2014 */ #pragma once #include #include #include #include #include "mockutils/Formatter.hpp" namespace fakeit { // helper function to print a tuple of Any size template struct TuplePrinter { static void print(std::ostream &strm, const Tuple &t) { TuplePrinter::print(strm, t); strm << ", " << fakeit::Formatter(t))>::format(std::get(t)); } }; template struct TuplePrinter { static void print(std::ostream &strm, const Tuple &t) { strm << fakeit::Formatter(t))>::format(std::get<0>(t)); } }; template struct TuplePrinter { static void print(std::ostream &, const Tuple &) { } }; template void print(std::ostream &strm, const std::tuple &t) { strm << "("; TuplePrinter::print(strm, t); strm << ")"; } template std::ostream &operator<<(std::ostream &strm, const std::tuple &t) { print(strm, t); return strm; } }