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
4b55caa9
Commit
4b55caa9
authored
Aug 26, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reflect inspector API change in docs
parent
0d97fcde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
manual/TypeInspection.rst
manual/TypeInspection.rst
+4
-4
No files found.
manual/TypeInspection.rst
View file @
4b55caa9
...
...
@@ -335,8 +335,8 @@ Specializing on the Data Format
-------------------------------
Much like ``is_loading`` allows client code to dispatch based on the mode of an
inspector, the
constant ``has_human_readable_format`` allows client code to
dispatch based on the data format.
inspector, the
member function ``has_human_readable_format()`` allows client
code to
dispatch based on the data format.
The canonical example for choosing a different data representation for
human-readable input and output is the ``enum`` type. When generating data for
...
...
@@ -372,7 +372,7 @@ an ``enum class`` otherwise.
template <class Inspector>
static bool apply_object(Inspector& f, weekday& x) {
if
constexpr (Inspector::has_human_readable_format
) {
if
(f.has_human_readable_format()
) {
auto get = [&x] { return to_string(x); };
auto set = [&x](std::string str) { return parse(str, x); };
f.object(x).fields(f.field("value", get, set));
...
...
@@ -383,7 +383,7 @@ an ``enum class`` otherwise.
template <class Inspector>
static bool apply_value(Inspector& f, weekday& x) {
if
constexpr (Inspector::has_human_readable_format
) {
if
(f.has_human_readable_format()
) {
auto get = [&x] { return to_string(x); };
auto set = [&x](std::string str) { return parse(str, x); };
return inspect_value(f, get, set);
...
...
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