]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/bimap/relation/support/pair_by.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / bimap / relation / support / pair_by.hpp
CommitLineData
7c673cae
FG
1// Boost.Bimap
2//
3// Copyright (c) 2006-2007 Matias Capeletto
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/// \file relation/support/pair_by.hpp
10/// \brief pair_by<member>(r) function
11
12#ifndef BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP
13#define BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP
14
15#if defined(_MSC_VER)
16#pragma once
17#endif
18
19#include <boost/config.hpp>
20
21#include <boost/bimap/relation/support/pair_type_by.hpp>
22#include <boost/bimap/relation/detail/access_builder.hpp>
23
24#ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
25
26namespace boost {
27namespace bimaps {
28namespace relation {
29namespace support {
30
31/** \brief Gets a pair view of the relation.
32
33\ingroup relation_group
34 **/
35
36template< class Tag, class Relation >
37BOOST_DEDUCED_TYPENAME result_of::pair_by<Tag,Relation>::type
38 pair_by( Relation & rel );
39
40} // namespace support
41} // namespace relation
42} // namespace bimaps
43} // namespace boost
44
45#endif // BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
46
47
48#ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
49
50namespace boost {
51namespace bimaps {
52namespace relation {
53namespace support {
54
55
56// Since it is very error-prone to directly write the hole bunch
20effc67 57// of relation accesor. They are built from little macro blocks that
7c673cae 58// are both more readable, leading to self docummenting code and a
20effc67 59// lot more easier to understand and maintain.
7c673cae
FG
60// It is very important to note that the three building blocks have
61// to laid in the same namespace in order to work. There is also
62// important to keep them in order.
20effc67 63// The forward declaration are not necessary but they help a lot to
7c673cae
FG
64// the reader, as they undercover what is the signature of the
65// result code.
66// In the end, it is not quicker to do it in this way because you
67// write a lot. But this code has no complexity at all and almost
68// every word writed is for documentation.
69
70// Result of
71// -------------------------------------------------------------------------
72/*
73 namespace result_of {
74
75 template< class Tag, class Relation >
76 struct pair_by<Tag,Relation>;
77 {
78 typedef -unspecified- type;
79 };
80
81 } // namespace result_of
82*/
83
84BOOST_BIMAP_SYMMETRIC_ACCESS_RESULT_OF_BUILDER
85(
86 pair_by,
87 pair_type_by
88)
89
90
91
92// Implementation
93// -------------------------------------------------------------------------
94
95BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
96(
97 pair_by,
98 Relation,
99 rel,
100 return rel.get_left_pair(),
101 return rel.get_right_pair()
102)
103
104// Interface
105// --------------------------------------------------------------------------
106
107BOOST_BIMAP_SYMMETRIC_ACCESS_INTERFACE_BUILDER
108(
109 pair_by
110)
111
112} // namespace support
113} // namespace relation
114} // namespace bimaps
115} // namespace boost
116
117
118#endif // BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
119
120#endif // BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP