Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
50b260db
Commit
50b260db
authored
Mar 12, 2021
by
Gauthier Quesnel
Browse files
core: replace template with function_ref
parent
ffde95a6
Pipeline
#28047
passed with stage
in 1 minute and 39 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
lib/include/irritator/core.hpp
View file @
50b260db
...
...
@@ -5855,8 +5855,8 @@ struct simulation
});
}
template
<
typename
Function
>
void
for_all_input_port
(
const
model
&
mdl
,
Function
f
)
void
for_all_input_port
(
const
model
&
mdl
,
function_ref
<
void
(
input_port
&
,
input_port_id
)
>
f
)
{
dispatch
(
mdl
.
type
,
[
this
,
&
f
,
dyn_id
=
mdl
.
id
]
<
typename
T
>
(
T
&
dyn_models
)
{
...
...
@@ -5873,8 +5873,8 @@ struct simulation
});
}
template
<
typename
Function
>
void
for_all_output_port
(
const
model
&
mdl
,
Function
f
)
void
for_all_output_port
(
const
model
&
mdl
,
function_ref
<
void
(
output_port
&
,
output_port_id
)
>
f
)
{
dispatch
(
mdl
.
type
,
[
this
,
&
f
,
dyn_id
=
mdl
.
id
]
<
typename
T
>
(
T
&
dyn_models
)
{
...
...
lib/include/irritator/io.hpp
View file @
50b260db
...
...
@@ -410,7 +410,8 @@ protected:
return
rc
;
}
std
::
streambuf
::
int_type
pbackfail
(
std
::
streambuf
::
int_type
c
)
override
final
std
::
streambuf
::
int_type
pbackfail
(
std
::
streambuf
::
int_type
c
)
override
final
{
if
(
traits_type
::
eq_int_type
(
c
,
traits_type
::
to_int_type
(
'\n'
)))
{
--
m_line_number
;
...
...
@@ -502,8 +503,8 @@ public:
return
status
::
success
;
}
template
<
typename
CallBackFunction
>
status
operator
()(
simulation
&
sim
,
CallBackFunction
f
)
noexcept
status
operator
()(
simulation
&
sim
,
function_ref
<
void
(
const
model_id
)
>
f
)
noexcept
{
irt_return_if_bad
(
do_read_model_number
());
...
...
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