// Copyright Joakim Karlsson & Kim Gräsman 2010-2012. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef IGLOO_STRINGIZERS_H #define IGLOO_STRINGIZERS_H namespace snowhouse { namespace detail { template struct SequentialContainerStringizer { static std::string ToString(const Container& cont) { std::ostringstream stm; typedef typename Container::const_iterator Iterator; stm << "[ "; for (Iterator it = cont.begin(); it != cont.end();) { stm << snowhouse::Stringize(*it); if (++it != cont.end()) { stm << ", "; } } stm << " ]"; return stm.str(); } }; } template struct Stringizer > : detail::SequentialContainerStringizer< std::vector > { }; template struct Stringizer > : detail::SequentialContainerStringizer< std::deque > { }; template struct Stringizer > : detail::SequentialContainerStringizer< std::list > { }; } #endif