comparison DEPENDENCIES/generic/include/boost/intrusive/parent_from_member.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 /////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2010-2013
4 //
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // See http://www.boost.org/libs/intrusive for documentation.
10 //
11 /////////////////////////////////////////////////////////////////////////////
12 #ifndef BOOST_INTRUSIVE_GET_PARENT_FROM_MEMBER_HPP
13 #define BOOST_INTRUSIVE_GET_PARENT_FROM_MEMBER_HPP
14
15 #include <boost/intrusive/detail/config_begin.hpp>
16 #include <boost/intrusive/detail/parent_from_member.hpp>
17
18 namespace boost {
19 namespace intrusive {
20
21 //! Given a pointer to a member and its corresponding pointer to data member,
22 //! this function returns the pointer of the parent containing that member.
23 //! Note: this function does not work with pointer to members that rely on
24 //! virtual inheritance.
25 template<class Parent, class Member>
26 inline Parent *get_parent_from_member(Member *member, const Member Parent::* ptr_to_member)
27 { return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); }
28
29 //! Given a const pointer to a member and its corresponding const pointer to data member,
30 //! this function returns the const pointer of the parent containing that member.
31 //! Note: this function does not work with pointer to members that rely on
32 //! virtual inheritance.
33 template<class Parent, class Member>
34 inline const Parent *get_parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
35 { return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); }
36
37 } //namespace intrusive {
38 } //namespace boost {
39
40 #include <boost/intrusive/detail/config_end.hpp>
41
42 #endif //#ifndef BOOST_INTRUSIVE_GET_PARENT_FROM_MEMBER_HPP