1 // Copyright (c) 2001-2011 Hartmut Kaiser
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_SPIRIT_KARMA_DIRECTIVE_STRICT_RELAXED_HPP
7 #define BOOST_SPIRIT_KARMA_DIRECTIVE_STRICT_RELAXED_HPP
13 #include <boost/spirit/home/support/common_terminals.hpp>
14 #include <boost/spirit/home/support/modify.hpp>
15 #include <boost/spirit/home/karma/domain.hpp>
16 #include <boost/spirit/home/karma/meta_compiler.hpp>
18 namespace boost { namespace spirit
20 ///////////////////////////////////////////////////////////////////////////
22 ///////////////////////////////////////////////////////////////////////////
24 struct use_directive<karma::domain, tag::strict> // enables strict[]
28 struct use_directive<karma::domain, tag::relaxed> // enables relaxed[]
31 ///////////////////////////////////////////////////////////////////////////
33 struct is_modifier_directive<karma::domain, tag::strict>
37 struct is_modifier_directive<karma::domain, tag::relaxed>
40 ///////////////////////////////////////////////////////////////////////////
41 // Don't add tag::strict or tag::relaxed if there is already one of those
42 // in the modifier list
43 template <typename Current>
44 struct compound_modifier<Current, tag::strict
45 , typename enable_if<has_modifier<Current, tag::relaxed> >::type>
51 compound_modifier(Current const& current, tag::strict const&)
55 template <typename Current>
56 struct compound_modifier<Current, tag::relaxed
57 , typename enable_if<has_modifier<Current, tag::strict> >::type>
63 compound_modifier(Current const& current, tag::relaxed const&)
69 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
70 using boost::spirit::strict;
71 using boost::spirit::relaxed;
73 using boost::spirit::strict_type;
74 using boost::spirit::relaxed_type;