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
66bbe75c
Commit
66bbe75c
authored
Apr 30, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build on GCC
parent
3dc9ed81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
libcaf_core/caf/error_code.hpp
libcaf_core/caf/error_code.hpp
+5
-7
No files found.
libcaf_core/caf/error_code.hpp
View file @
66bbe75c
...
@@ -33,7 +33,7 @@ class error_code {
...
@@ -33,7 +33,7 @@ class error_code {
public:
public:
using
enum_type
=
Enum
;
using
enum_type
=
Enum
;
using
underlying_type
=
typename
std
::
underlying_type
<
enum_type
>::
type
;
using
underlying_type
=
std
::
underlying_type_t
<
Enum
>
;
static_assert
(
is_error_code_enum_v
<
Enum
>
);
static_assert
(
is_error_code_enum_v
<
Enum
>
);
...
@@ -68,16 +68,14 @@ public:
...
@@ -68,16 +68,14 @@ public:
return
value_
;
return
value_
;
}
}
friend
constexpr
underlying_type
to_integer
(
error_code
x
)
noexcept
{
return
static_cast
<
std
::
underlying_type_t
<
Enum
>>
(
x
.
value
());
}
private:
private:
enum_type
value_
;
enum_type
value_
;
};
};
/// Returns the value of the underlying integer type of `x`.
template
<
class
Enum
,
class
=
std
::
enable_if_t
<
is_error_code_enum_v
<
Enum
>
>>
constexpr
auto
to_integer
(
error_code
<
Enum
>
x
)
noexcept
{
return
static_cast
<
typename
error_code
<
Enum
>::
underlying_type
>
(
x
.
value
());
}
/// Converts `x` to a string if `Enum` provides a `to_string` function.
/// Converts `x` to a string if `Enum` provides a `to_string` function.
template
<
class
Enum
>
template
<
class
Enum
>
auto
to_string
(
error_code
<
Enum
>
x
)
->
decltype
(
to_string
(
x
.
value
()))
{
auto
to_string
(
error_code
<
Enum
>
x
)
->
decltype
(
to_string
(
x
.
value
()))
{
...
...
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