]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/local_function/include/boost/local_function/aux_/member.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / local_function / include / boost / local_function / aux_ / member.hpp
CommitLineData
7c673cae
FG
1
2// Copyright (C) 2009-2012 Lorenzo Caminiti
3// Distributed under the Boost Software License, Version 1.0
4// (see accompanying file LICENSE_1_0.txt or a copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6// Home at http://www.boost.org/libs/local_function
7
8#ifndef BOOST_LOCAL_FUNCTION_AUX_MEMBER_HPP_
9#define BOOST_LOCAL_FUNCTION_AUX_MEMBER_HPP_
10
11namespace boost { namespace local_function { namespace aux {
12
13// Metafunctions to manipulate data members.
14
15template<typename T> struct member_type {
16 typedef T& reference;
17 typedef T* pointer;
18};
19
20template<typename T> struct member_type<T*> {
21 typedef T*& reference;
22 typedef T* pointer;
23};
24
25template<typename T> struct member_type<T* const> {
26 typedef T* const& reference;
27 typedef T* pointer;
28};
29
30template<typename T> struct member_type<T const*> {
31 typedef T const*& reference;
32 typedef T const* pointer;
33};
34
35template<typename T> struct member_type<T const* const> {
36 typedef T const* const& reference;
37 typedef T const* pointer;
38};
39
40// NOTE: Do not add specializations for T const[&/*] (ambiguous on VACPP).
41template<typename T> T* member_addr(T& data) { return &data; }
42template<typename T> T* member_addr(T* data) { return data; }
43
44// NOTE: Do not add specializations for T const[&/*] (ambiguous on VACPP).
45template<typename T> T& member_deref(T& data) { return data; }
46template<typename T> T& member_deref(T* data) { return *data; }
47
48} } } // namespace
49
50#endif // #include guard
51