Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:47:37

0001 //  Copyright (c) 2001-2011 Hartmut Kaiser
0002 // 
0003 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
0004 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_STRICT_RELAXED_HPP
0007 #define BOOST_SPIRIT_KARMA_DIRECTIVE_STRICT_RELAXED_HPP
0008 
0009 #if defined(_MSC_VER)
0010 #pragma once
0011 #endif
0012 
0013 #include <boost/spirit/home/support/common_terminals.hpp>
0014 #include <boost/spirit/home/support/modify.hpp>
0015 #include <boost/spirit/home/karma/domain.hpp>
0016 #include <boost/spirit/home/karma/meta_compiler.hpp>
0017 
0018 namespace boost { namespace spirit
0019 {
0020     ///////////////////////////////////////////////////////////////////////////
0021     // Enablers
0022     ///////////////////////////////////////////////////////////////////////////
0023     template <>
0024     struct use_directive<karma::domain, tag::strict>  // enables strict[]
0025       : mpl::true_ {};
0026 
0027     template <>
0028     struct use_directive<karma::domain, tag::relaxed> // enables relaxed[]
0029       : mpl::true_ {};
0030 
0031     ///////////////////////////////////////////////////////////////////////////
0032     template <>
0033     struct is_modifier_directive<karma::domain, tag::strict>
0034       : mpl::true_ {};
0035 
0036     template <>
0037     struct is_modifier_directive<karma::domain, tag::relaxed>
0038       : mpl::true_ {};
0039 
0040     ///////////////////////////////////////////////////////////////////////////
0041     // Don't add tag::strict or tag::relaxed if there is already one of those 
0042     // in the modifier list
0043     template <typename Current>
0044     struct compound_modifier<Current, tag::strict
0045           , typename enable_if<has_modifier<Current, tag::relaxed> >::type>
0046       : Current
0047     {
0048         compound_modifier()
0049           : Current() {}
0050 
0051         compound_modifier(Current const& current, tag::strict const&)
0052           : Current(current) {}
0053     };
0054 
0055     template <typename Current>
0056     struct compound_modifier<Current, tag::relaxed
0057           , typename enable_if<has_modifier<Current, tag::strict> >::type>
0058       : Current
0059     {
0060         compound_modifier()
0061           : Current() {}
0062 
0063         compound_modifier(Current const& current, tag::relaxed const&)
0064           : Current(current) {}
0065     };
0066 
0067     namespace karma
0068     {
0069 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
0070         using boost::spirit::strict;
0071         using boost::spirit::relaxed;
0072 #endif
0073         using boost::spirit::strict_type;
0074         using boost::spirit::relaxed_type;
0075     }
0076 }}
0077 
0078 #endif