Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
54b4acea
Commit
54b4acea
authored
May 18, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #197 from RosettaCommons/fix
Refactoring bind_vector to take std::string
parents
3f200fab
065526a3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
include/pybind11/stl_bind.h
+3
-3
No files found.
include/pybind11/stl_bind.h
View file @
54b4acea
...
@@ -108,7 +108,7 @@ void vector_if_equal_operator(Class_ &cl) {
...
@@ -108,7 +108,7 @@ void vector_if_equal_operator(Class_ &cl) {
);
);
}
}
template
<
typename
Vector
,
typename
Class_
>
auto
vector_if_insertion_operator
(
Class_
&
cl
,
const
char
*
name
)
template
<
typename
Vector
,
typename
Class_
>
auto
vector_if_insertion_operator
(
Class_
&
cl
,
std
::
string
const
&
name
)
->
decltype
(
std
::
declval
<
std
::
ostream
&>
()
<<
std
::
declval
<
typename
Vector
::
value_type
>
(),
void
())
{
->
decltype
(
std
::
declval
<
std
::
ostream
&>
()
<<
std
::
declval
<
typename
Vector
::
value_type
>
(),
void
())
{
using
size_type
=
typename
Vector
::
size_type
;
using
size_type
=
typename
Vector
::
size_type
;
...
@@ -132,12 +132,12 @@ NAMESPACE_END(detail)
...
@@ -132,12 +132,12 @@ NAMESPACE_END(detail)
template
<
typename
T
,
typename
Allocator
=
std
::
allocator
<
T
>
,
typename
holder_type
=
std
::
unique_ptr
<
std
::
vector
<
T
,
Allocator
>>
,
typename
...
Args
>
template
<
typename
T
,
typename
Allocator
=
std
::
allocator
<
T
>
,
typename
holder_type
=
std
::
unique_ptr
<
std
::
vector
<
T
,
Allocator
>>
,
typename
...
Args
>
pybind11
::
class_
<
std
::
vector
<
T
,
Allocator
>
,
holder_type
>
bind_vector
(
pybind11
::
module
&
m
,
const
char
*
name
,
Args
&&
...
args
)
{
pybind11
::
class_
<
std
::
vector
<
T
,
Allocator
>
,
holder_type
>
bind_vector
(
pybind11
::
module
&
m
,
std
::
string
const
&
name
,
Args
&&
...
args
)
{
using
Vector
=
std
::
vector
<
T
,
Allocator
>
;
using
Vector
=
std
::
vector
<
T
,
Allocator
>
;
using
SizeType
=
typename
Vector
::
size_type
;
using
SizeType
=
typename
Vector
::
size_type
;
using
Class_
=
pybind11
::
class_
<
Vector
,
holder_type
>
;
using
Class_
=
pybind11
::
class_
<
Vector
,
holder_type
>
;
Class_
cl
(
m
,
name
,
std
::
forward
<
Args
>
(
args
)...);
Class_
cl
(
m
,
name
.
c_str
()
,
std
::
forward
<
Args
>
(
args
)...);
cl
.
def
(
pybind11
::
init
<>
());
cl
.
def
(
pybind11
::
init
<>
());
...
...
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