Chris@16
|
1 // Copyright (c) 2001-2011 Hartmut Kaiser
|
Chris@16
|
2 //
|
Chris@16
|
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
5
|
Chris@16
|
6 #if !defined(BOOST_SPIRIT_KARMA_BOOL_SEP_28_2009_1113AM)
|
Chris@16
|
7 #define BOOST_SPIRIT_KARMA_BOOL_SEP_28_2009_1113AM
|
Chris@16
|
8
|
Chris@16
|
9 #if defined(_MSC_VER)
|
Chris@16
|
10 #pragma once
|
Chris@16
|
11 #endif
|
Chris@16
|
12
|
Chris@16
|
13 #include <boost/limits.hpp>
|
Chris@16
|
14 #include <boost/mpl/bool.hpp>
|
Chris@16
|
15 #include <boost/utility/enable_if.hpp>
|
Chris@16
|
16
|
Chris@16
|
17 #include <boost/spirit/home/support/common_terminals.hpp>
|
Chris@16
|
18 #include <boost/spirit/home/support/string_traits.hpp>
|
Chris@16
|
19 #include <boost/spirit/home/support/numeric_traits.hpp>
|
Chris@16
|
20 #include <boost/spirit/home/support/info.hpp>
|
Chris@16
|
21 #include <boost/spirit/home/support/char_class.hpp>
|
Chris@16
|
22 #include <boost/spirit/home/karma/meta_compiler.hpp>
|
Chris@16
|
23 #include <boost/spirit/home/karma/delimit_out.hpp>
|
Chris@16
|
24 #include <boost/spirit/home/karma/auxiliary/lazy.hpp>
|
Chris@16
|
25 #include <boost/spirit/home/karma/detail/get_casetag.hpp>
|
Chris@16
|
26 #include <boost/spirit/home/karma/detail/extract_from.hpp>
|
Chris@16
|
27 #include <boost/spirit/home/karma/detail/enable_lit.hpp>
|
Chris@16
|
28 #include <boost/spirit/home/karma/domain.hpp>
|
Chris@16
|
29 #include <boost/spirit/home/karma/numeric/bool_policies.hpp>
|
Chris@16
|
30 #include <boost/spirit/home/karma/numeric/detail/bool_utils.hpp>
|
Chris@16
|
31
|
Chris@16
|
32 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
33 namespace boost { namespace spirit
|
Chris@16
|
34 {
|
Chris@16
|
35 namespace karma
|
Chris@16
|
36 {
|
Chris@16
|
37 ///////////////////////////////////////////////////////////////////////
|
Chris@16
|
38 // forward declaration only
|
Chris@16
|
39 template <typename T>
|
Chris@16
|
40 struct bool_policies;
|
Chris@16
|
41
|
Chris@16
|
42 ///////////////////////////////////////////////////////////////////////
|
Chris@16
|
43 // This is the class that the user can instantiate directly in
|
Chris@16
|
44 // order to create a customized bool generator
|
Chris@16
|
45 template <typename T = bool, typename Policies = bool_policies<T> >
|
Chris@16
|
46 struct bool_generator
|
Chris@16
|
47 : spirit::terminal<tag::stateful_tag<Policies, tag::bool_, T> >
|
Chris@16
|
48 {
|
Chris@16
|
49 typedef tag::stateful_tag<Policies, tag::bool_, T> tag_type;
|
Chris@16
|
50
|
Chris@16
|
51 bool_generator() {}
|
Chris@16
|
52 bool_generator(Policies const& data)
|
Chris@16
|
53 : spirit::terminal<tag_type>(data) {}
|
Chris@16
|
54 };
|
Chris@16
|
55 }
|
Chris@16
|
56
|
Chris@16
|
57 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
58 // Enablers
|
Chris@16
|
59 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
60 template <>
|
Chris@16
|
61 struct use_terminal<karma::domain, tag::bool_> // enables bool_
|
Chris@16
|
62 : mpl::true_ {};
|
Chris@16
|
63
|
Chris@16
|
64 template <>
|
Chris@16
|
65 struct use_terminal<karma::domain, tag::true_> // enables true_
|
Chris@16
|
66 : mpl::true_ {};
|
Chris@16
|
67
|
Chris@16
|
68 template <>
|
Chris@16
|
69 struct use_terminal<karma::domain, tag::false_> // enables false_
|
Chris@16
|
70 : mpl::true_ {};
|
Chris@16
|
71
|
Chris@16
|
72 template <>
|
Chris@16
|
73 struct use_terminal<karma::domain, bool> // enables lit(true)
|
Chris@16
|
74 : mpl::true_ {};
|
Chris@16
|
75
|
Chris@16
|
76 template <typename A0>
|
Chris@16
|
77 struct use_terminal<karma::domain // enables bool_(...)
|
Chris@16
|
78 , terminal_ex<tag::bool_, fusion::vector1<A0> >
|
Chris@16
|
79 > : mpl::true_ {};
|
Chris@16
|
80
|
Chris@16
|
81 template <> // enables *lazy* bool_(...)
|
Chris@16
|
82 struct use_lazy_terminal<karma::domain, tag::bool_, 1>
|
Chris@16
|
83 : mpl::true_ {};
|
Chris@16
|
84
|
Chris@16
|
85 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
86 // enables any custom bool_generator
|
Chris@16
|
87 template <typename Policies, typename T>
|
Chris@16
|
88 struct use_terminal<karma::domain
|
Chris@16
|
89 , tag::stateful_tag<Policies, tag::bool_, T> >
|
Chris@16
|
90 : mpl::true_ {};
|
Chris@16
|
91
|
Chris@16
|
92 // enables any custom bool_generator(...)
|
Chris@16
|
93 template <typename Policies, typename T, typename A0>
|
Chris@16
|
94 struct use_terminal<karma::domain
|
Chris@16
|
95 , terminal_ex<tag::stateful_tag<Policies, tag::bool_, T>
|
Chris@16
|
96 , fusion::vector1<A0> > >
|
Chris@16
|
97 : mpl::true_ {};
|
Chris@16
|
98
|
Chris@16
|
99 // enables *lazy* custom bool_generator
|
Chris@16
|
100 template <typename Policies, typename T>
|
Chris@16
|
101 struct use_lazy_terminal<karma::domain
|
Chris@16
|
102 , tag::stateful_tag<Policies, tag::bool_, T>, 1>
|
Chris@16
|
103 : mpl::true_ {};
|
Chris@16
|
104
|
Chris@16
|
105 // enables lit(bool)
|
Chris@16
|
106 template <typename A0>
|
Chris@16
|
107 struct use_terminal<karma::domain
|
Chris@16
|
108 , terminal_ex<tag::lit, fusion::vector1<A0> >
|
Chris@16
|
109 , typename enable_if<traits::is_bool<A0> >::type>
|
Chris@16
|
110 : mpl::true_ {};
|
Chris@16
|
111 }}
|
Chris@16
|
112
|
Chris@16
|
113 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
114 namespace boost { namespace spirit { namespace karma
|
Chris@16
|
115 {
|
Chris@16
|
116 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
|
Chris@16
|
117 using spirit::bool_;
|
Chris@16
|
118 using spirit::true_;
|
Chris@16
|
119 using spirit::false_;
|
Chris@16
|
120 using spirit::lit; // lit(true) is equivalent to true
|
Chris@16
|
121 #endif
|
Chris@16
|
122
|
Chris@16
|
123 using spirit::bool_type;
|
Chris@16
|
124 using spirit::true_type;
|
Chris@16
|
125 using spirit::false_type;
|
Chris@16
|
126 using spirit::lit_type;
|
Chris@16
|
127
|
Chris@16
|
128 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
129 // This specialization is used for bool generators not having a direct
|
Chris@16
|
130 // initializer: bool_. These generators must be used in conjunction with
|
Chris@16
|
131 // an Attribute.
|
Chris@16
|
132 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
133 template <typename T, typename CharEncoding, typename Tag, typename Policies>
|
Chris@16
|
134 struct any_bool_generator
|
Chris@16
|
135 : primitive_generator<any_bool_generator<T, CharEncoding, Tag, Policies> >
|
Chris@16
|
136 {
|
Chris@16
|
137 public:
|
Chris@16
|
138 any_bool_generator(Policies const& p = Policies())
|
Chris@16
|
139 : p_(p) {}
|
Chris@16
|
140
|
Chris@16
|
141 typedef typename Policies::properties properties;
|
Chris@16
|
142
|
Chris@16
|
143 template <typename Context, typename Unused>
|
Chris@16
|
144 struct attribute
|
Chris@16
|
145 {
|
Chris@16
|
146 typedef T type;
|
Chris@16
|
147 };
|
Chris@16
|
148
|
Chris@16
|
149 // bool_ has a Attribute attached
|
Chris@16
|
150 template <typename OutputIterator, typename Context, typename Delimiter
|
Chris@16
|
151 , typename Attribute>
|
Chris@16
|
152 bool
|
Chris@16
|
153 generate(OutputIterator& sink, Context& context, Delimiter const& d
|
Chris@16
|
154 , Attribute const& attr) const
|
Chris@16
|
155 {
|
Chris@16
|
156 if (!traits::has_optional_value(attr))
|
Chris@16
|
157 return false; // fail if it's an uninitialized optional
|
Chris@16
|
158
|
Chris@16
|
159 return bool_inserter<T, Policies, CharEncoding, Tag>::call(
|
Chris@16
|
160 sink, traits::extract_from<T>(attr, context), p_) &&
|
Chris@16
|
161 delimit_out(sink, d); // always do post-delimiting
|
Chris@16
|
162 }
|
Chris@16
|
163
|
Chris@16
|
164 // this bool_ has no Attribute attached, it needs to have been
|
Chris@16
|
165 // initialized from a direct literal
|
Chris@16
|
166 template <typename OutputIterator, typename Context, typename Delimiter>
|
Chris@16
|
167 static bool
|
Chris@16
|
168 generate(OutputIterator&, Context&, Delimiter const&, unused_type)
|
Chris@16
|
169 {
|
Chris@16
|
170 // It is not possible (doesn't make sense) to use boolean generators
|
Chris@16
|
171 // without providing any attribute, as the generator doesn't 'know'
|
Chris@16
|
172 // what to output. The following assertion fires if this situation
|
Chris@16
|
173 // is detected in your code.
|
Chris@16
|
174 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, bool_not_usable_without_attribute, ());
|
Chris@16
|
175 return false;
|
Chris@16
|
176 }
|
Chris@16
|
177
|
Chris@16
|
178 template <typename Context>
|
Chris@16
|
179 static info what(Context const& /*context*/)
|
Chris@16
|
180 {
|
Chris@16
|
181 return info("bool");
|
Chris@16
|
182 }
|
Chris@16
|
183
|
Chris@16
|
184 Policies p_;
|
Chris@16
|
185 };
|
Chris@16
|
186
|
Chris@16
|
187 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
188 // This specialization is used for bool generators having a direct
|
Chris@16
|
189 // initializer: bool_(true), bool_(0) etc.
|
Chris@16
|
190 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
191 template <typename T, typename CharEncoding, typename Tag
|
Chris@16
|
192 , typename Policies, bool no_attribute>
|
Chris@16
|
193 struct literal_bool_generator
|
Chris@16
|
194 : primitive_generator<literal_bool_generator<T, CharEncoding, Tag
|
Chris@16
|
195 , Policies, no_attribute> >
|
Chris@16
|
196 {
|
Chris@16
|
197 public:
|
Chris@16
|
198 typedef typename Policies::properties properties;
|
Chris@16
|
199
|
Chris@16
|
200 template <typename Context, typename Unused = unused_type>
|
Chris@16
|
201 struct attribute
|
Chris@16
|
202 : mpl::if_c<no_attribute, unused_type, T>
|
Chris@16
|
203 {};
|
Chris@16
|
204
|
Chris@16
|
205 literal_bool_generator(typename add_const<T>::type n
|
Chris@16
|
206 , Policies const& p = Policies())
|
Chris@16
|
207 : n_(n), p_(p) {}
|
Chris@16
|
208
|
Chris@16
|
209 // A bool_() which additionally has an associated attribute emits
|
Chris@16
|
210 // its immediate literal only if it matches the attribute, otherwise
|
Chris@16
|
211 // it fails.
|
Chris@16
|
212 template <typename OutputIterator, typename Context, typename Delimiter
|
Chris@16
|
213 , typename Attribute>
|
Chris@16
|
214 bool generate(OutputIterator& sink, Context& context
|
Chris@16
|
215 , Delimiter const& d, Attribute const& attr) const
|
Chris@16
|
216 {
|
Chris@16
|
217 typedef typename attribute<Context>::type attribute_type;
|
Chris@16
|
218 if (!traits::has_optional_value(attr) ||
|
Chris@16
|
219 bool(n_) != bool(traits::extract_from<attribute_type>(attr, context)))
|
Chris@16
|
220 {
|
Chris@16
|
221 return false;
|
Chris@16
|
222 }
|
Chris@16
|
223 return bool_inserter<T, Policies, CharEncoding, Tag>::
|
Chris@16
|
224 call(sink, n_, p_) && delimit_out(sink, d);
|
Chris@16
|
225 }
|
Chris@16
|
226
|
Chris@16
|
227 // A bool_() without any associated attribute just emits its
|
Chris@16
|
228 // immediate literal
|
Chris@16
|
229 template <typename OutputIterator, typename Context, typename Delimiter>
|
Chris@16
|
230 bool generate(OutputIterator& sink, Context&, Delimiter const& d
|
Chris@16
|
231 , unused_type) const
|
Chris@16
|
232 {
|
Chris@16
|
233 return bool_inserter<T, Policies, CharEncoding, Tag>::
|
Chris@16
|
234 call(sink, n_) && delimit_out(sink, d);
|
Chris@16
|
235 }
|
Chris@16
|
236
|
Chris@16
|
237 template <typename Context>
|
Chris@16
|
238 static info what(Context const& /*context*/)
|
Chris@16
|
239 {
|
Chris@16
|
240 return info("bool");
|
Chris@16
|
241 }
|
Chris@16
|
242
|
Chris@16
|
243 T n_;
|
Chris@16
|
244 Policies p_;
|
Chris@16
|
245 };
|
Chris@16
|
246
|
Chris@16
|
247 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
248 // Generator generators: make_xxx function (objects)
|
Chris@16
|
249 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
250 namespace detail
|
Chris@16
|
251 {
|
Chris@16
|
252 template <typename Modifiers, typename T = bool
|
Chris@16
|
253 , typename Policies = bool_policies<T> >
|
Chris@16
|
254 struct make_bool
|
Chris@16
|
255 {
|
Chris@16
|
256 static bool const lower =
|
Chris@16
|
257 has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
|
Chris@16
|
258 static bool const upper =
|
Chris@16
|
259 has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
|
Chris@16
|
260
|
Chris@16
|
261 typedef any_bool_generator<
|
Chris@16
|
262 T
|
Chris@16
|
263 , typename spirit::detail::get_encoding_with_case<
|
Chris@16
|
264 Modifiers, unused_type, lower || upper>::type
|
Chris@16
|
265 , typename detail::get_casetag<Modifiers, lower || upper>::type
|
Chris@16
|
266 , Policies
|
Chris@16
|
267 > result_type;
|
Chris@16
|
268
|
Chris@16
|
269 template <typename Terminal>
|
Chris@16
|
270 result_type operator()(Terminal const& term, unused_type) const
|
Chris@16
|
271 {
|
Chris@16
|
272 typedef tag::stateful_tag<Policies, tag::bool_, T> tag_type;
|
Chris@16
|
273 using spirit::detail::get_stateful_data;
|
Chris@16
|
274 return result_type(get_stateful_data<tag_type>::call(term));
|
Chris@16
|
275 }
|
Chris@16
|
276 };
|
Chris@16
|
277
|
Chris@16
|
278 template <typename Modifiers, bool b>
|
Chris@16
|
279 struct make_bool_literal
|
Chris@16
|
280 {
|
Chris@16
|
281 static bool const lower =
|
Chris@16
|
282 has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
|
Chris@16
|
283 static bool const upper =
|
Chris@16
|
284 has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
|
Chris@16
|
285
|
Chris@16
|
286 typedef literal_bool_generator<
|
Chris@16
|
287 bool
|
Chris@16
|
288 , typename spirit::detail::get_encoding_with_case<
|
Chris@16
|
289 Modifiers, unused_type, lower || upper>::type
|
Chris@16
|
290 , typename detail::get_casetag<Modifiers, lower || upper>::type
|
Chris@16
|
291 , bool_policies<>, false
|
Chris@16
|
292 > result_type;
|
Chris@16
|
293
|
Chris@16
|
294 result_type operator()(unused_type, unused_type) const
|
Chris@16
|
295 {
|
Chris@16
|
296 return result_type(b);
|
Chris@16
|
297 }
|
Chris@16
|
298 };
|
Chris@16
|
299 }
|
Chris@16
|
300
|
Chris@16
|
301 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
302 template <typename Modifiers>
|
Chris@16
|
303 struct make_primitive<tag::bool_, Modifiers>
|
Chris@16
|
304 : detail::make_bool<Modifiers> {};
|
Chris@16
|
305
|
Chris@16
|
306 template <typename Modifiers>
|
Chris@16
|
307 struct make_primitive<tag::true_, Modifiers>
|
Chris@16
|
308 : detail::make_bool_literal<Modifiers, true> {};
|
Chris@16
|
309
|
Chris@16
|
310 template <typename Modifiers>
|
Chris@16
|
311 struct make_primitive<tag::false_, Modifiers>
|
Chris@16
|
312 : detail::make_bool_literal<Modifiers, false> {};
|
Chris@16
|
313
|
Chris@16
|
314 template <typename T, typename Policies, typename Modifiers>
|
Chris@16
|
315 struct make_primitive<
|
Chris@16
|
316 tag::stateful_tag<Policies, tag::bool_, T>, Modifiers>
|
Chris@16
|
317 : detail::make_bool<Modifiers
|
Chris@16
|
318 , typename remove_const<T>::type, Policies> {};
|
Chris@16
|
319
|
Chris@16
|
320 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
321 namespace detail
|
Chris@16
|
322 {
|
Chris@16
|
323 template <typename Modifiers, typename T = bool
|
Chris@16
|
324 , typename Policies = bool_policies<T> >
|
Chris@16
|
325 struct make_bool_direct
|
Chris@16
|
326 {
|
Chris@16
|
327 static bool const lower =
|
Chris@16
|
328 has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
|
Chris@16
|
329 static bool const upper =
|
Chris@16
|
330 has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
|
Chris@16
|
331
|
Chris@16
|
332 typedef literal_bool_generator<
|
Chris@16
|
333 T
|
Chris@16
|
334 , typename spirit::detail::get_encoding_with_case<
|
Chris@16
|
335 Modifiers, unused_type, lower || upper>::type
|
Chris@16
|
336 , typename detail::get_casetag<Modifiers, lower || upper>::type
|
Chris@16
|
337 , Policies, false
|
Chris@16
|
338 > result_type;
|
Chris@16
|
339
|
Chris@16
|
340 template <typename Terminal>
|
Chris@16
|
341 result_type operator()(Terminal const& term, unused_type) const
|
Chris@16
|
342 {
|
Chris@16
|
343 typedef tag::stateful_tag<Policies, tag::bool_, T> tag_type;
|
Chris@16
|
344 using spirit::detail::get_stateful_data;
|
Chris@16
|
345 return result_type(fusion::at_c<0>(term.args)
|
Chris@16
|
346 , get_stateful_data<tag_type>::call(term.term));
|
Chris@16
|
347 }
|
Chris@16
|
348 };
|
Chris@16
|
349 }
|
Chris@16
|
350
|
Chris@16
|
351 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
352 template <typename Modifiers, typename A0>
|
Chris@16
|
353 struct make_primitive<
|
Chris@16
|
354 terminal_ex<tag::bool_, fusion::vector1<A0> >, Modifiers>
|
Chris@16
|
355 : detail::make_bool_direct<Modifiers> {};
|
Chris@16
|
356
|
Chris@16
|
357 template <typename T, typename Policies, typename A0, typename Modifiers>
|
Chris@16
|
358 struct make_primitive<
|
Chris@16
|
359 terminal_ex<tag::stateful_tag<Policies, tag::bool_, T>
|
Chris@16
|
360 , fusion::vector1<A0> >
|
Chris@16
|
361 , Modifiers>
|
Chris@16
|
362 : detail::make_bool_direct<Modifiers
|
Chris@16
|
363 , typename remove_const<T>::type, Policies> {};
|
Chris@16
|
364
|
Chris@16
|
365 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
366 namespace detail
|
Chris@16
|
367 {
|
Chris@16
|
368 template <typename Modifiers>
|
Chris@16
|
369 struct basic_bool_literal
|
Chris@16
|
370 {
|
Chris@16
|
371 static bool const lower =
|
Chris@16
|
372 has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
|
Chris@16
|
373 static bool const upper =
|
Chris@16
|
374 has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
|
Chris@16
|
375
|
Chris@16
|
376 typedef literal_bool_generator<
|
Chris@16
|
377 bool
|
Chris@16
|
378 , typename spirit::detail::get_encoding_with_case<
|
Chris@16
|
379 Modifiers, unused_type, lower || upper>::type
|
Chris@16
|
380 , typename detail::get_casetag<Modifiers, lower || upper>::type
|
Chris@16
|
381 , bool_policies<>, true
|
Chris@16
|
382 > result_type;
|
Chris@16
|
383
|
Chris@16
|
384 template <typename T_>
|
Chris@16
|
385 result_type operator()(T_ i, unused_type) const
|
Chris@16
|
386 {
|
Chris@16
|
387 return result_type(i);
|
Chris@16
|
388 }
|
Chris@16
|
389 };
|
Chris@16
|
390 }
|
Chris@16
|
391
|
Chris@16
|
392 template <typename Modifiers>
|
Chris@16
|
393 struct make_primitive<bool, Modifiers>
|
Chris@16
|
394 : detail::basic_bool_literal<Modifiers> {};
|
Chris@16
|
395
|
Chris@16
|
396 template <typename Modifiers, typename A0>
|
Chris@16
|
397 struct make_primitive<
|
Chris@16
|
398 terminal_ex<tag::lit, fusion::vector1<A0> >
|
Chris@16
|
399 , Modifiers
|
Chris@16
|
400 , typename enable_if<traits::is_bool<A0> >::type>
|
Chris@16
|
401 : detail::basic_bool_literal<Modifiers>
|
Chris@16
|
402 {
|
Chris@16
|
403 static bool const lower =
|
Chris@16
|
404 has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
|
Chris@16
|
405 static bool const upper =
|
Chris@16
|
406 has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
|
Chris@16
|
407
|
Chris@16
|
408 typedef literal_bool_generator<
|
Chris@16
|
409 bool
|
Chris@16
|
410 , typename spirit::detail::get_encoding_with_case<
|
Chris@16
|
411 Modifiers, unused_type, lower || upper>::type
|
Chris@16
|
412 , typename detail::get_casetag<Modifiers, lower || upper>::type
|
Chris@16
|
413 , bool_policies<>, true
|
Chris@16
|
414 > result_type;
|
Chris@16
|
415
|
Chris@16
|
416 template <typename Terminal>
|
Chris@16
|
417 result_type operator()(Terminal const& term, unused_type) const
|
Chris@16
|
418 {
|
Chris@16
|
419 return result_type(fusion::at_c<0>(term.args));
|
Chris@16
|
420 }
|
Chris@16
|
421 };
|
Chris@16
|
422 }}}
|
Chris@16
|
423
|
Chris@16
|
424 #endif
|