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
e51b17f4
Commit
e51b17f4
authored
Jul 10, 2023
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate review feedback
parent
b19c8721
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
9 deletions
+4
-9
CMakeLists.txt
CMakeLists.txt
+0
-2
libcaf_core/caf/detail/format.hpp
libcaf_core/caf/detail/format.hpp
+1
-7
libcaf_core/caf/detail/is_one_of.hpp
libcaf_core/caf/detail/is_one_of.hpp
+3
-0
No files found.
CMakeLists.txt
View file @
e51b17f4
...
@@ -175,8 +175,6 @@ if(NOT DEFINED CAF_USE_STD_FORMAT)
...
@@ -175,8 +175,6 @@ if(NOT DEFINED CAF_USE_STD_FORMAT)
message
(
STATUS
"Disable std::format support: NOT available"
)
message
(
STATUS
"Disable std::format support: NOT available"
)
endif
()
endif
()
endif
()
endif
()
else
()
set
(
CAF_USE_STD_FORMAT OFF CACHE BOOL
"Enable std::format support"
FORCE
)
endif
()
endif
()
# -- export internal target (may be useful for re-using compiler flags) --------
# -- export internal target (may be useful for re-using compiler flags) --------
...
...
libcaf_core/caf/detail/format.hpp
View file @
e51b17f4
...
@@ -52,9 +52,7 @@ using format_arg = std::variant<bool, char, int64_t, uint64_t, double,
...
@@ -52,9 +52,7 @@ using format_arg = std::variant<bool, char, int64_t, uint64_t, double,
template
<
class
T
>
template
<
class
T
>
format_arg
make_format_arg
(
const
T
&
arg
)
{
format_arg
make_format_arg
(
const
T
&
arg
)
{
if
constexpr
(
std
::
is_same_v
<
T
,
bool
>
)
{
if
constexpr
(
is_one_of_v
<
T
,
bool
,
char
,
const
char
*
,
std
::
string_view
>
)
{
return
format_arg
{
arg
};
}
else
if
constexpr
(
std
::
is_same_v
<
T
,
char
>
)
{
return
format_arg
{
arg
};
return
format_arg
{
arg
};
}
else
if
constexpr
(
std
::
is_integral_v
<
T
>
)
{
}
else
if
constexpr
(
std
::
is_integral_v
<
T
>
)
{
if
constexpr
(
std
::
is_signed_v
<
T
>
)
{
if
constexpr
(
std
::
is_signed_v
<
T
>
)
{
...
@@ -64,12 +62,8 @@ format_arg make_format_arg(const T& arg) {
...
@@ -64,12 +62,8 @@ format_arg make_format_arg(const T& arg) {
}
}
}
else
if
constexpr
(
std
::
is_floating_point_v
<
T
>
)
{
}
else
if
constexpr
(
std
::
is_floating_point_v
<
T
>
)
{
return
format_arg
{
static_cast
<
double
>
(
arg
)};
return
format_arg
{
static_cast
<
double
>
(
arg
)};
}
else
if
constexpr
(
std
::
is_same_v
<
T
,
const
char
*>
)
{
return
format_arg
{
arg
};
}
else
if
constexpr
(
std
::
is_same_v
<
T
,
std
::
string
>
)
{
}
else
if
constexpr
(
std
::
is_same_v
<
T
,
std
::
string
>
)
{
return
format_arg
{
std
::
string_view
{
arg
}};
return
format_arg
{
std
::
string_view
{
arg
}};
}
else
if
constexpr
(
std
::
is_same_v
<
T
,
std
::
string_view
>
)
{
return
format_arg
{
arg
};
}
else
{
}
else
{
static_assert
(
std
::
is_pointer_v
<
T
>
,
"unsupported argument type"
);
static_assert
(
std
::
is_pointer_v
<
T
>
,
"unsupported argument type"
);
return
format_arg
{
static_cast
<
const
void
*>
(
arg
)};
return
format_arg
{
static_cast
<
const
void
*>
(
arg
)};
...
...
libcaf_core/caf/detail/is_one_of.hpp
View file @
e51b17f4
...
@@ -21,4 +21,7 @@ struct is_one_of<T, T, Ts...> : std::true_type {};
...
@@ -21,4 +21,7 @@ struct is_one_of<T, T, Ts...> : std::true_type {};
template
<
class
T
,
class
U
,
class
...
Ts
>
template
<
class
T
,
class
U
,
class
...
Ts
>
struct
is_one_of
<
T
,
U
,
Ts
...
>
:
is_one_of
<
T
,
Ts
...
>
{};
struct
is_one_of
<
T
,
U
,
Ts
...
>
:
is_one_of
<
T
,
Ts
...
>
{};
template
<
class
T
,
class
...
Ts
>
constexpr
bool
is_one_of_v
=
(
std
::
is_same_v
<
T
,
Ts
>
||
...);
}
// namespace caf::detail
}
// namespace caf::detail
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