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
b95d96aa
Commit
b95d96aa
authored
Aug 06, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to string_view in make_error
parent
04ba5ea6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
libcaf_core/caf/pec.hpp
libcaf_core/caf/pec.hpp
+3
-1
libcaf_core/src/pec.cpp
libcaf_core/src/pec.cpp
+3
-2
No files found.
libcaf_core/caf/pec.hpp
View file @
b95d96aa
...
...
@@ -18,7 +18,9 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <string>
#include "caf/fwd.hpp"
...
...
@@ -74,7 +76,7 @@ error make_error(pec code, size_t line, size_t column);
/// Returns an error object from given error code with additional context
/// information for where the parser stopped in the argument.
error
make_error
(
pec
code
,
st
d
::
string
argument
);
error
make_error
(
pec
code
,
st
ring_view
argument
);
/// @relates pec
const
char
*
to_string
(
pec
x
);
...
...
libcaf_core/src/pec.cpp
View file @
b95d96aa
...
...
@@ -21,6 +21,7 @@
#include "caf/config_value.hpp"
#include "caf/error.hpp"
#include "caf/make_message.hpp"
#include "caf/string_view.hpp"
namespace
{
...
...
@@ -61,9 +62,9 @@ error make_error(pec code, size_t line, size_t column) {
make_message
(
std
::
move
(
context
))};
}
error
make_error
(
pec
code
,
st
d
::
string
argument
)
{
error
make_error
(
pec
code
,
st
ring_view
argument
)
{
config_value
::
dictionary
context
;
context
[
"argument"
]
=
std
::
move
(
argument
)
;
context
[
"argument"
]
=
std
::
string
{
argument
.
begin
(),
argument
.
end
()}
;
return
{
static_cast
<
uint8_t
>
(
code
),
atom
(
"parser"
),
make_message
(
std
::
move
(
context
))};
}
...
...
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