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
06bd27f5
Commit
06bd27f5
authored
Nov 15, 2016
by
Wenzel Jakob
Browse files
import size_t into pybind11 namespace (fixes #498)
parent
07806558
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
include/pybind11/common.h
include/pybind11/common.h
+4
-2
No files found.
include/pybind11/common.h
View file @
06bd27f5
...
@@ -93,6 +93,7 @@
...
@@ -93,6 +93,7 @@
# pragma warning(pop)
# pragma warning(pop)
#endif
#endif
#include <cstddef>
#include <forward_list>
#include <forward_list>
#include <vector>
#include <vector>
#include <string>
#include <string>
...
@@ -182,7 +183,8 @@ extern "C" {
...
@@ -182,7 +183,8 @@ extern "C" {
NAMESPACE_BEGIN
(
pybind11
)
NAMESPACE_BEGIN
(
pybind11
)
typedef
Py_ssize_t
ssize_t
;
using
ssize_t
=
Py_ssize_t
;
using
size_t
=
std
::
size_t
;
/// Approach used to cast a previously unknown C++ instance into a Python object
/// Approach used to cast a previously unknown C++ instance into a Python object
enum
class
return_value_policy
:
uint8_t
{
enum
class
return_value_policy
:
uint8_t
{
...
@@ -320,7 +322,7 @@ template <typename type, typename holder_type = std::unique_ptr<type>> struct in
...
@@ -320,7 +322,7 @@ template <typename type, typename holder_type = std::unique_ptr<type>> struct in
};
};
struct
overload_hash
{
struct
overload_hash
{
inline
std
::
size_t
operator
()(
const
std
::
pair
<
const
PyObject
*
,
const
char
*>&
v
)
const
{
inline
size_t
operator
()(
const
std
::
pair
<
const
PyObject
*
,
const
char
*>&
v
)
const
{
size_t
value
=
std
::
hash
<
const
void
*>
()(
v
.
first
);
size_t
value
=
std
::
hash
<
const
void
*>
()(
v
.
first
);
value
^=
std
::
hash
<
const
void
*>
()(
v
.
second
)
+
0x9e3779b9
+
(
value
<<
6
)
+
(
value
>>
2
);
value
^=
std
::
hash
<
const
void
*>
()(
v
.
second
)
+
0x9e3779b9
+
(
value
<<
6
)
+
(
value
>>
2
);
return
value
;
return
value
;
...
...
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