Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
54289302
Commit
54289302
authored
Oct 26, 2015
by
Wenzel Jakob
Browse files
minor cleanups
parent
42af9c29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+4
-7
No files found.
include/pybind11/pybind11.h
View file @
54289302
...
@@ -32,7 +32,7 @@ template <typename T> struct arg_t;
...
@@ -32,7 +32,7 @@ template <typename T> struct arg_t;
/// Annotation for keyword arguments
/// Annotation for keyword arguments
struct
arg
{
struct
arg
{
arg
(
const
char
*
name
)
:
name
(
name
)
{
}
arg
(
const
char
*
name
)
:
name
(
name
)
{
}
template
<
typename
T
>
inline
arg_t
<
T
>
operator
=
(
const
T
&
value
);
template
<
typename
T
>
arg_t
<
T
>
operator
=
(
const
T
&
value
);
const
char
*
name
;
const
char
*
name
;
};
};
...
@@ -41,13 +41,10 @@ template <typename T> struct arg_t : public arg {
...
@@ -41,13 +41,10 @@ template <typename T> struct arg_t : public arg {
arg_t
(
const
char
*
name
,
const
T
&
value
)
:
arg
(
name
),
value
(
value
)
{
}
arg_t
(
const
char
*
name
,
const
T
&
value
)
:
arg
(
name
),
value
(
value
)
{
}
T
value
;
T
value
;
};
};
template
<
typename
T
>
inline
arg_t
<
T
>
arg
::
operator
=
(
const
T
&
value
)
{
return
arg_t
<
T
>
(
name
,
value
);
}
template
<
typename
T
>
arg_t
<
T
>
arg
::
operator
=
(
const
T
&
value
)
{
return
arg_t
<
T
>
(
name
,
value
);
}
/// Annotation for methods
/// Annotation for methods
struct
is_method
{
struct
is_method
{
PyObject
*
class_
;
is_method
(
object
*
o
)
:
class_
(
o
->
ptr
())
{
}
};
PyObject
*
class_
;
is_method
(
object
*
o
)
:
class_
(
o
->
ptr
())
{
}
};
/// Annotation for documentation
/// Annotation for documentation
struct
doc
{
const
char
*
value
;
doc
(
const
char
*
value
)
:
value
(
value
)
{
}
};
struct
doc
{
const
char
*
value
;
doc
(
const
char
*
value
)
:
value
(
value
)
{
}
};
...
@@ -67,9 +64,9 @@ private:
...
@@ -67,9 +64,9 @@ private:
PyObject
*
(
*
impl
)
(
function_entry
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
)
=
nullptr
;
PyObject
*
(
*
impl
)
(
function_entry
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
)
=
nullptr
;
PyMethodDef
*
def
=
nullptr
;
PyMethodDef
*
def
=
nullptr
;
void
*
data
=
nullptr
;
void
*
data
=
nullptr
;
void
(
*
free
)
(
void
*
ptr
)
=
nullptr
;
bool
is_constructor
=
false
,
is_method
=
false
;
bool
is_constructor
=
false
,
is_method
=
false
;
short
keywords
=
0
;
short
keywords
=
0
;
void
(
*
free
)
(
void
*
ptr
)
=
nullptr
;
return_value_policy
policy
=
return_value_policy
::
automatic
;
return_value_policy
policy
=
return_value_policy
::
automatic
;
std
::
string
signature
;
std
::
string
signature
;
PyObject
*
class_
=
nullptr
;
PyObject
*
class_
=
nullptr
;
...
...
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