Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
17a85cab
Commit
17a85cab
authored
May 04, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use if constexpr where appropriate
parent
d5b15662
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
133 deletions
+122
-133
libcaf_core/caf/config_value.hpp
libcaf_core/caf/config_value.hpp
+120
-120
libcaf_core/caf/make_config_option.hpp
libcaf_core/caf/make_config_option.hpp
+2
-13
No files found.
libcaf_core/caf/config_value.hpp
View file @
17a85cab
This diff is collapsed.
Click to expand it.
libcaf_core/caf/make_config_option.hpp
View file @
17a85cab
...
@@ -52,25 +52,14 @@ config_value get_impl(const void* ptr) {
...
@@ -52,25 +52,14 @@ config_value get_impl(const void* ptr) {
return
config_value
{
trait
::
convert
(
*
reinterpret_cast
<
const
T
*>
(
ptr
))};
return
config_value
{
trait
::
convert
(
*
reinterpret_cast
<
const
T
*>
(
ptr
))};
}
}
template
<
class
T
>
typename
std
::
enable_if
<
detail
::
has_clear_member
<
T
>::
value
>::
type
clear_before_parsing
(
T
&
xs
)
{
xs
.
clear
();
}
template
<
class
T
>
typename
std
::
enable_if
<!
detail
::
has_clear_member
<
T
>::
value
>::
type
clear_before_parsing
(
T
&
)
{
// nop
}
template
<
class
T
>
template
<
class
T
>
expected
<
config_value
>
parse_impl
(
T
*
ptr
,
string_view
str
)
{
expected
<
config_value
>
parse_impl
(
T
*
ptr
,
string_view
str
)
{
if
(
!
ptr
)
{
if
(
!
ptr
)
{
T
tmp
;
T
tmp
;
return
parse_impl
(
&
tmp
,
str
);
return
parse_impl
(
&
tmp
,
str
);
}
}
clear_before_parsing
(
*
ptr
);
if
constexpr
(
detail
::
has_clear_member
<
T
>::
value
)
ptr
->
clear
();
using
trait
=
select_config_value_access_t
<
T
>
;
using
trait
=
select_config_value_access_t
<
T
>
;
string_parser_state
ps
{
str
.
begin
(),
str
.
end
()};
string_parser_state
ps
{
str
.
begin
(),
str
.
end
()};
trait
::
parse_cli
(
ps
,
*
ptr
,
top_level_cli_parsing
);
trait
::
parse_cli
(
ps
,
*
ptr
,
top_level_cli_parsing
);
...
...
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