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
2709eb10
Commit
2709eb10
authored
Jul 31, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow using meta::hex_formatted for integer types
parent
6620e854
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
libcaf_core/caf/detail/append_hex.hpp
libcaf_core/caf/detail/append_hex.hpp
+16
-0
libcaf_core/caf/detail/stringification_inspector.hpp
libcaf_core/caf/detail/stringification_inspector.hpp
+1
-2
No files found.
libcaf_core/caf/detail/append_hex.hpp
View file @
2709eb10
...
...
@@ -19,11 +19,27 @@
#pragma once
#include <string>
#include <type_traits>
#include "caf/detail/type_traits.hpp"
namespace
caf
{
namespace
detail
{
void
append_hex
(
std
::
string
&
result
,
const
uint8_t
*
xs
,
size_t
n
);
template
<
class
T
>
enable_if_t
<
has_data_member
<
T
>::
value
>
append_hex
(
std
::
string
&
result
,
const
T
&
x
)
{
return
append_hex
(
result
,
reinterpret_cast
<
const
uint8_t
*>
(
x
.
data
()),
x
.
size
());
}
template
<
class
T
>
enable_if_t
<
std
::
is_integral
<
T
>::
value
>
append_hex
(
std
::
string
&
result
,
const
T
&
x
)
{
return
append_hex
(
result
,
reinterpret_cast
<
const
uint8_t
*>
(
&
x
),
sizeof
(
T
));
}
}
// namespace detail
}
// namespace caf
libcaf_core/caf/detail/stringification_inspector.hpp
View file @
2709eb10
...
...
@@ -276,8 +276,7 @@ public:
template
<
class
T
,
class
...
Ts
>
void
traverse
(
const
meta
::
hex_formatted_t
&
,
const
T
&
x
,
const
Ts
&
...
xs
)
{
sep
();
append_hex
(
result_
,
reinterpret_cast
<
uint8_t
*>
(
deconst
(
x
).
data
()),
x
.
size
());
append_hex
(
result_
,
x
);
traverse
(
xs
...);
}
...
...
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