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
db0007bb
Commit
db0007bb
authored
Jun 17, 2023
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing compare overload
parent
23cb4188
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
CHANGELOG.md
CHANGELOG.md
+6
-0
libcaf_core/caf/telemetry/label.hpp
libcaf_core/caf/telemetry/label.hpp
+2
-0
libcaf_core/src/telemetry/label.cpp
libcaf_core/src/telemetry/label.cpp
+7
-1
No files found.
CHANGELOG.md
View file @
db0007bb
...
...
@@ -6,6 +6,12 @@ is based on [Keep a Changelog](https://keepachangelog.com).
## [Unreleased]
### Added
-
The class
`caf::telemetry::label`
now has a new
`compare`
overload that
accepts a
`caf::telemetry::label_view`
to make the interface of the both
classes symmetrical.
### Changed
-
When using CAF to parse CLI arguments, the output of
`--help`
now includes all
...
...
libcaf_core/caf/telemetry/label.hpp
View file @
db0007bb
...
...
@@ -53,6 +53,8 @@ public:
// -- comparison -------------------------------------------------------------
int
compare
(
const
label_view
&
x
)
const
noexcept
;
int
compare
(
const
label
&
x
)
const
noexcept
;
private:
...
...
libcaf_core/src/telemetry/label.cpp
View file @
db0007bb
...
...
@@ -25,8 +25,14 @@ void label::value(std::string_view new_value) {
str_
.
insert
(
str_
.
end
(),
new_value
.
begin
(),
new_value
.
end
());
}
int
label
::
compare
(
const
label_view
&
x
)
const
noexcept
{
auto
cmp1
=
name
().
compare
(
x
.
name
());
return
cmp1
!=
0
?
cmp1
:
value
().
compare
(
x
.
value
());
}
int
label
::
compare
(
const
label
&
x
)
const
noexcept
{
return
str_
.
compare
(
x
.
str
());
auto
cmp1
=
name
().
compare
(
x
.
name
());
return
cmp1
!=
0
?
cmp1
:
value
().
compare
(
x
.
value
());
}
std
::
string
to_string
(
const
label
&
x
)
{
...
...
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