• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2009 Christopher Schmidt
3 
4     Distributed under the Boost Software License, Version 1.0. (See accompanying
5     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 
8 #ifndef BOOST_FUSION_EXAMPLE_EXTENSION_DETAIL_KEY_OF_IMPL_HPP
9 #define BOOST_FUSION_EXAMPLE_EXTENSION_DETAIL_KEY_OF_IMPL_HPP
10 
11 #include <boost/mpl/if.hpp>
12 
13 namespace fields
14 {
15     struct name;
16     struct age;
17 }
18 
19 namespace example
20 {
21     struct example_struct_iterator_tag;
22 }
23 
24 namespace boost { namespace fusion {
25 
26     namespace extension
27     {
28         template<typename Tag>
29         struct key_of_impl;
30 
31         template<>
32         struct key_of_impl<example::example_struct_iterator_tag>
33         {
34             template<typename It>
35             struct apply
36               : mpl::if_c<!It::index::value, fields::name, fields::age>
37             {};
38         };
39     }
40 }}
41 
42 #endif
43