Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
71867830
"tests/test_virtual_functions.cpp" did not exist on "8f4eb006901553ccfa010b75660f979ab1ef31a4"
Commit
71867830
authored
Jul 29, 2015
by
Wenzel Jakob
Browse files
switched cpp_function to use variadic arguments
parent
fbe82bf9
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
211 additions
and
175 deletions
+211
-175
include/pybind/operators.h
include/pybind/operators.h
+10
-10
include/pybind/pybind.h
include/pybind/pybind.h
+201
-165
No files found.
include/pybind/operators.h
View file @
71867830
...
...
@@ -45,17 +45,17 @@ template <op_id, op_type, typename B, typename L, typename R> struct op_impl { }
/// Operator implementation generator
template
<
op_id
id
,
op_type
ot
,
typename
L
,
typename
R
>
struct
op_
{
template
<
typename
b
ase
,
typename
h
older
>
void
execute
(
pybind
::
class_
<
b
ase
,
h
older
>
&
class_
,
const
char
*
doc
,
return_value_policy
policy
)
const
{
typedef
typename
std
::
conditional
<
std
::
is_same
<
L
,
self_t
>::
value
,
b
ase
,
L
>::
type
L_type
;
typedef
typename
std
::
conditional
<
std
::
is_same
<
R
,
self_t
>::
value
,
b
ase
,
R
>::
type
R_type
;
typedef
op_impl
<
id
,
ot
,
b
ase
,
L_type
,
R_type
>
op
;
class_
.
def
(
op
::
name
(),
&
op
::
execute
,
doc
,
policy
);
template
<
typename
B
ase
,
typename
H
older
,
typename
...
Extra
>
void
execute
(
pybind
::
class_
<
B
ase
,
H
older
>
&
class_
,
Extra
&&
...
extra
)
const
{
typedef
typename
std
::
conditional
<
std
::
is_same
<
L
,
self_t
>::
value
,
B
ase
,
L
>::
type
L_type
;
typedef
typename
std
::
conditional
<
std
::
is_same
<
R
,
self_t
>::
value
,
B
ase
,
R
>::
type
R_type
;
typedef
op_impl
<
id
,
ot
,
B
ase
,
L_type
,
R_type
>
op
;
class_
.
def
(
op
::
name
(),
&
op
::
execute
,
std
::
forward
<
Extra
>
(
extra
)...
);
}
template
<
typename
b
ase
,
typename
h
older
>
void
execute_cast
(
pybind
::
class_
<
b
ase
,
h
older
>
&
class_
,
const
char
*
doc
,
return_value_policy
policy
)
const
{
typedef
typename
std
::
conditional
<
std
::
is_same
<
L
,
self_t
>::
value
,
b
ase
,
L
>::
type
L_type
;
typedef
typename
std
::
conditional
<
std
::
is_same
<
R
,
self_t
>::
value
,
b
ase
,
R
>::
type
R_type
;
typedef
op_impl
<
id
,
ot
,
b
ase
,
L_type
,
R_type
>
op
;
class_
.
def
(
op
::
name
(),
&
op
::
execute_cast
,
doc
,
policy
);
template
<
typename
B
ase
,
typename
H
older
,
typename
...
Extra
>
void
execute_cast
(
pybind
::
class_
<
B
ase
,
H
older
>
&
class_
,
Extra
&&
...
extra
)
const
{
typedef
typename
std
::
conditional
<
std
::
is_same
<
L
,
self_t
>::
value
,
B
ase
,
L
>::
type
L_type
;
typedef
typename
std
::
conditional
<
std
::
is_same
<
R
,
self_t
>::
value
,
B
ase
,
R
>::
type
R_type
;
typedef
op_impl
<
id
,
ot
,
B
ase
,
L_type
,
R_type
>
op
;
class_
.
def
(
op
::
name
(),
&
op
::
execute_cast
,
std
::
forward
<
Extra
>
(
extra
)...
);
}
};
...
...
include/pybind/pybind.h
View file @
71867830
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment