Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tom Niget
typon
Commits
4d973371
Commit
4d973371
authored
Jul 08, 2023
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add forwarding constructors to PyDict and PyStr
parent
a0d00404
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
rt/include/python/builtins/dict.hpp
rt/include/python/builtins/dict.hpp
+3
-1
rt/include/python/builtins/str.hpp
rt/include/python/builtins/str.hpp
+2
-2
No files found.
rt/include/python/builtins/dict.hpp
View file @
4d973371
...
...
@@ -89,10 +89,12 @@ public:
PyDict
(
std
::
unordered_map
<
K
,
V
>
&&
m
)
:
_m
(
std
::
move
(
std
::
make_shared
<
std
::
unordered_map
<
K
,
V
>>
(
std
::
move
(
m
))))
{}
PyDict
(
std
::
initializer_list
<
std
::
pair
<
K
,
V
>>
&&
m
)
PyDict
(
std
::
initializer_list
<
std
::
pair
<
const
K
,
V
>>
&&
m
)
:
_m
(
std
::
make_shared
<
std
::
unordered_map
<
K
,
V
>>
(
std
::
move
(
m
)))
{}
PyDict
()
:
_m
(
std
::
make_shared
<
std
::
unordered_map
<
K
,
V
>>
())
{}
template
<
typename
...
Args
>
PyDict
(
Args
&&
...
args
)
:
_m
(
std
::
make_shared
<
std
::
unordered_map
<
K
,
V
>>
(
std
::
forward
<
Args
>
(
args
)...))
{}
auto
begin
()
const
{
return
_m
->
begin
();
}
auto
end
()
const
{
return
_m
->
end
();
}
...
...
rt/include/python/builtins/str.hpp
View file @
4d973371
...
...
@@ -18,11 +18,11 @@ using namespace std::literals;
class
PyStr
:
public
std
::
string
{
public:
PyStr
()
:
std
::
string
()
{}
PyStr
(
const
char
*
s
)
:
std
::
string
(
s
)
{}
PyStr
(
const
std
::
string
&
s
)
:
std
::
string
(
s
)
{}
PyStr
(
std
::
string
&&
s
)
:
std
::
string
(
std
::
move
(
s
))
{}
PyStr
(
size_t
count
,
char
ch
)
:
std
::
string
(
count
,
ch
)
{}
constexpr
PyStr
(
const
char
*
s
,
size_t
count
)
:
std
::
string
(
s
,
count
)
{}
template
<
typename
...
Args
>
PyStr
(
Args
&&
...
args
)
:
std
::
string
(
std
::
forward
<
Args
>
(
args
)...)
{}
template
<
class
InputIterator
>
PyStr
(
InputIterator
first
,
InputIterator
last
)
:
std
::
string
(
first
,
last
)
{}
...
...
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