Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon-compiler
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
typon
typon-compiler
Commits
fd8f5b68
Commit
fd8f5b68
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
1efd4296
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 @
fd8f5b68
...
@@ -89,10 +89,12 @@ public:
...
@@ -89,10 +89,12 @@ public:
PyDict
(
std
::
unordered_map
<
K
,
V
>
&&
m
)
PyDict
(
std
::
unordered_map
<
K
,
V
>
&&
m
)
:
_m
(
std
::
move
(
:
_m
(
std
::
move
(
std
::
make_shared
<
std
::
unordered_map
<
K
,
V
>>
(
std
::
move
(
m
))))
{}
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
)))
{}
:
_m
(
std
::
make_shared
<
std
::
unordered_map
<
K
,
V
>>
(
std
::
move
(
m
)))
{}
PyDict
()
:
_m
(
std
::
make_shared
<
std
::
unordered_map
<
K
,
V
>>
())
{}
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
begin
()
const
{
return
_m
->
begin
();
}
auto
end
()
const
{
return
_m
->
end
();
}
auto
end
()
const
{
return
_m
->
end
();
}
...
...
rt/include/python/builtins/str.hpp
View file @
fd8f5b68
...
@@ -18,11 +18,11 @@ using namespace std::literals;
...
@@ -18,11 +18,11 @@ using namespace std::literals;
class
PyStr
:
public
std
::
string
{
class
PyStr
:
public
std
::
string
{
public:
public:
PyStr
()
:
std
::
string
()
{}
PyStr
()
:
std
::
string
()
{}
PyStr
(
const
char
*
s
)
:
std
::
string
(
s
)
{}
PyStr
(
const
std
::
string
&
s
)
:
std
::
string
(
s
)
{}
PyStr
(
const
std
::
string
&
s
)
:
std
::
string
(
s
)
{}
PyStr
(
std
::
string
&&
s
)
:
std
::
string
(
std
::
move
(
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
)
{}
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
>
template
<
class
InputIterator
>
PyStr
(
InputIterator
first
,
InputIterator
last
)
:
std
::
string
(
first
,
last
)
{}
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