~twpol/dcplusplus/trunk

« back to all changes in this revision

Viewing changes to boost/boost/fusion/adapted/struct/detail/at_key_impl.hpp

  • Committer: James Ross
  • Date: 2010-07-05 00:03:18 UTC
  • mfrom: (1524.1.650 dcplusplus)
  • Revision ID: silver@warwickcompsoc.co.uk-20100705000318-awwqm8ocpp5m47yz
Merged to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*=============================================================================
2
 
    Copyright (c) 2001-2007 Joel de Guzman
3
 
    Copyright (c) 2005-2007 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_AT_KEY_IMPL_20070508_2248)
9
 
#define BOOST_FUSION_AT_KEY_IMPL_20070508_2248
10
 
 
11
 
#include <boost/fusion/support/detail/access.hpp>
12
 
 
13
 
namespace boost { namespace fusion
14
 
{
15
 
    struct struct_tag;
16
 
 
17
 
    namespace extension
18
 
    {
19
 
        template<typename T>
20
 
        struct at_key_impl;
21
 
 
22
 
        template <typename Struct, typename Key>
23
 
        struct struct_assoc_member;
24
 
 
25
 
        template <>
26
 
        struct at_key_impl<struct_tag>
27
 
        {
28
 
            template <typename Sequence, typename Key>
29
 
            struct apply
30
 
            {
31
 
                typedef typename
32
 
                extension::struct_assoc_member<Sequence, Key>
33
 
                element;
34
 
 
35
 
                typedef typename
36
 
                    mpl::eval_if<
37
 
                        is_const<Sequence>
38
 
                      , detail::cref_result<element>
39
 
                      , detail::ref_result<element>
40
 
                    >::type
41
 
                type;
42
 
 
43
 
                static type
44
 
                call(Sequence& seq)
45
 
                {
46
 
                    return extension::
47
 
                        struct_assoc_member<Sequence, Key>::call(seq);
48
 
                }
49
 
            };
50
 
        };
51
 
    }
52
 
}}
53
 
 
54
 
#endif
 
1
/*=============================================================================
 
2
    Copyright (c) 2001-2007 Joel de Guzman
 
3
    Copyright (c) 2005-2007 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_AT_KEY_IMPL_20070508_2248)
 
9
#define BOOST_FUSION_AT_KEY_IMPL_20070508_2248
 
10
 
 
11
#include <boost/fusion/support/detail/access.hpp>
 
12
 
 
13
namespace boost { namespace fusion
 
14
{
 
15
    struct struct_tag;
 
16
 
 
17
    namespace extension
 
18
    {
 
19
        template<typename T>
 
20
        struct at_key_impl;
 
21
 
 
22
        template <typename Struct, typename Key>
 
23
        struct struct_assoc_member;
 
24
 
 
25
        template <>
 
26
        struct at_key_impl<struct_tag>
 
27
        {
 
28
            template <typename Sequence, typename Key>
 
29
            struct apply
 
30
            {
 
31
                typedef typename
 
32
                extension::struct_assoc_member<Sequence, Key>
 
33
                element;
 
34
 
 
35
                typedef typename
 
36
                    mpl::eval_if<
 
37
                        is_const<Sequence>
 
38
                      , detail::cref_result<element>
 
39
                      , detail::ref_result<element>
 
40
                    >::type
 
41
                type;
 
42
 
 
43
                static type
 
44
                call(Sequence& seq)
 
45
                {
 
46
                    return extension::
 
47
                        struct_assoc_member<Sequence, Key>::call(seq);
 
48
                }
 
49
            };
 
50
        };
 
51
    }
 
52
}}
 
53
 
 
54
#endif