• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2001-2011 Joel de Guzman
3     Copyright (c) 2005-2006 Dan Marsden
4 
5     Distributed under the Boost Software License, Version 1.0. (See accompanying
6     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_FUSION_HAS_KEY_IMPL_20060223_2156)
9 #define BOOST_FUSION_HAS_KEY_IMPL_20060223_2156
10 
11 #include <boost/type_traits/is_same.hpp>
12 #include <boost/mpl/or.hpp>
13 
14 namespace fields
15 {
16     struct name;
17     struct age;
18 }
19 
20 namespace example
21 {
22     struct example_sequence_tag;
23 }
24 
25 namespace boost { namespace fusion {
26 
27     namespace extension
28     {
29         template<typename Tag>
30         struct has_key_impl;
31 
32         template<>
33         struct has_key_impl<example::example_sequence_tag>
34         {
35             template<typename Sequence, typename Key>
36             struct apply
37                 : mpl::or_<
38                 is_same<Key, fields::name>,
39                 is_same<Key, fields::age> >
40             {};
41         };
42     }
43 }}
44 
45 #endif
46