FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/include/boost/python/def_visitor.hpp at develop · shelltdf/python · GitHub
shelltdf
/
python
Public
forked from
boostorg/python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
include
/
boost
/
python
/
def_visitor.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
86 lines (71 loc) · 2.43 KB
Breadcrumbs
python
/
include
/
boost
/
python
/
def_visitor.hpp
Copy path
File metadata and controls
86 lines (71 loc) · 2.43 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//
Copyright David Abrahams 2003.
//
Distributed under the Boost Software License, Version 1.0. (See
//
accompanying file LICENSE_1_0.txt or copy at
//
http://www.boost.org/LICENSE_1_0.txt)
#
ifndef
DEF_VISITOR_DWA2003810_HPP
#
define
DEF_VISITOR_DWA2003810_HPP
#
include
<
boost/python/detail/prefix.hpp
>
#
include
<
boost/detail/workaround.hpp
>
namespace
boost
{
namespace
python
{
template
<
class
DerivedVisitor
>
class
def_visitor
;
template
<
class
T
,
class
X1
,
class
X2
,
class
X3
>
class
class_
;
class
def_visitor_access
{
#
if
defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \
||
BOOST_WORKAROUND
(
BOOST_BORLANDC
,
BOOST_TESTED_AT
(
0x551
))
//
Tasteless as this may seem, making all members public allows member templates
//
to work in the absence of member template friends.
public:
#
else
template
<
class
Derived
>
friend
class
def_visitor
;
#
endif
//
unnamed visit, c.f. init<...>, container suites
template
<
class
V
,
class
classT
>
static
void
visit
(V
const
& v, classT& c)
{
v.
derived_visitor
().
visit
(c);
}
//
named visit, c.f. object, pure_virtual
template
<
class
V
,
class
classT
,
class
OptionalArgs
>
static
void
visit
(
V
const
& v
, classT& c
,
char
const
* name
, OptionalArgs
const
& options
)
{
v.
derived_visitor
().
visit
(c, name, options);
}
};
template
<
class
DerivedVisitor
>
class
def_visitor
{
friend
class
def_visitor_access
;
#
if
defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \
||
BOOST_WORKAROUND
(
BOOST_BORLANDC
,
BOOST_TESTED_AT
(
0x551
))
//
Tasteless as this may seem, making all members public allows member templates
//
to work in the absence of member template friends.
public:
#
else
template
<
class
T
,
class
X1
,
class
X2
,
class
X3
>
friend
class
class_
;
#
endif
//
unnamed visit, c.f. init<...>, container suites
template
<
class
classT
>
void
visit
(classT& c)
const
{
def_visitor_access::visit
(*
this
, c);
}
//
named visit, c.f. object, pure_virtual
template
<
class
classT
,
class
OptionalArgs
>
void
visit
(classT& c,
char
const
* name, OptionalArgs
const
& options)
const
{
def_visitor_access::visit
(*
this
, c, name, options);
}
protected:
DerivedVisitor
const
&
derived_visitor
()
const
{
return
static_cast
<DerivedVisitor
const
&>(*
this
);
}
};
}}
//
namespace boost::python
#
endif
//
DEF_VISITOR_DWA2003810_HPP
Back
|
FazBrowse Home
|
New Git URL