Chris@16: // Copyright (c) 2001-2011 Hartmut Kaiser Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #if !defined(BOOST_SPIRIT_KARMA_UNUSED_DELIMITER_MAR_15_2009_0923PM) Chris@16: #define BOOST_SPIRIT_KARMA_UNUSED_DELIMITER_MAR_15_2009_0923PM Chris@16: Chris@16: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { namespace spirit { namespace karma { namespace detail Chris@16: { Chris@16: template Chris@16: struct unused_delimiter : unused_type Chris@16: { Chris@16: unused_delimiter(Delimiter const& delim) Chris@16: : delimiter(delim) {} Chris@16: Delimiter const& delimiter; Chris@16: Chris@16: private: Chris@16: // silence MSVC warning C4512: assignment operator could not be generated Chris@16: unused_delimiter& operator= (unused_delimiter const&); Chris@16: }; Chris@16: Chris@16: // If a surrounding verbatim[] directive was specified, the current Chris@16: // delimiter is of the type unused_delimiter. In this case we Chris@16: // re-activate the delimiter which was active before the verbatim[] Chris@16: // directive. Chris@16: template Chris@16: inline Delimiter const& Chris@16: get_delimiter(unused_delimiter const& u, Default const&) Chris@16: { Chris@16: return u.delimiter; Chris@16: } Chris@16: Chris@16: // If no surrounding verbatim[] directive was specified we activate Chris@16: // a single space as the delimiter to use. Chris@16: template Chris@16: inline Default const& Chris@16: get_delimiter(Delimiter const&, Default const& d) Chris@16: { Chris@16: return d; Chris@16: } Chris@16: Chris@16: }}}} Chris@16: Chris@16: #endif