// Copyright (c) 2001-2010 Hartmut Kaiser // // 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) #if !defined(BOOST_SPIRIT_KARMA_BOOL_UTILS_SEP_28_2009_0644PM) #define BOOST_SPIRIT_KARMA_BOOL_UTILS_SEP_28_2009_0644PM #if defined(_MSC_VER) #pragma once #endif #include #include #include #include #include #include namespace boost { namespace spirit { namespace karma { /////////////////////////////////////////////////////////////////////////// // // The bool_inserter template takes care of the boolean to string // conversion. The Policies template parameter is used to allow // customization of the formatting process // /////////////////////////////////////////////////////////////////////////// template struct bool_policies; template , typename CharEncoding = unused_type , typename Tag = unused_type> struct bool_inserter { template static bool call (OutputIterator& sink, U b, Policies const& p = Policies()) { #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600)) p; // suppresses warning: C4100: 'p' : unreferenced formal parameter #endif return p.template call(sink, T(b), p); } /////////////////////////////////////////////////////////////////////// // This is the workhorse behind the real generator /////////////////////////////////////////////////////////////////////// template static bool call_n (OutputIterator& sink, U b, Policies const& p) { #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600)) p; // suppresses warning: C4100: 'p' : unreferenced formal parameter #endif if (b) return p.template generate_true(sink, b); return p.template generate_false(sink, b); } }; }}} #endif