Fix comments, reenable config_consumer test

parent 04f71904
...@@ -115,8 +115,8 @@ private: ...@@ -115,8 +115,8 @@ private:
/// Finds `config_option` string with a matching long name in (`first`, `last`], /// Finds `config_option` string with a matching long name in (`first`, `last`],
/// where each entry is a pointer to a string. Returns a `ForwardIterator` to /// where each entry is a pointer to a string. Returns a `ForwardIterator` to
/// the match and a `caf::std::string_view` of the option value if the entry is /// the match and a `string_view` of the option value if the entry is
/// found and a `ForwardIterator` to `last` with an empty `std::string_view` /// found and a `ForwardIterator` to `last` with an empty `string_view`
/// otherwise. /// otherwise.
template <class ForwardIterator, class Sentinel> template <class ForwardIterator, class Sentinel>
std::pair<ForwardIterator, std::string_view> std::pair<ForwardIterator, std::string_view>
......
...@@ -500,7 +500,7 @@ expected<T> get_as(const config_value& value) { ...@@ -500,7 +500,7 @@ expected<T> get_as(const config_value& value) {
/// Customization point for configuring automatic mappings from default value /// Customization point for configuring automatic mappings from default value
/// types to deduced types. For example, `get_or(value, "foo"sv)` must return a /// types to deduced types. For example, `get_or(value, "foo"sv)` must return a
/// `string` rather than a `std::string_view`. However, user-defined overloads /// `string` rather than a `string_view`. However, user-defined overloads
/// *must not* specialize this class for any type from the namespaces `std` or /// *must not* specialize this class for any type from the namespaces `std` or
/// `caf`. /// `caf`.
template <class T> template <class T>
......
...@@ -19,7 +19,7 @@ namespace caf { ...@@ -19,7 +19,7 @@ namespace caf {
/// ~~~(cpp) /// ~~~(cpp)
/// enum class Enumeration : ... { ... }; /// enum class Enumeration : ... { ... };
/// std::string to_string(Enumeration); /// std::string to_string(Enumeration);
/// bool from_string(std::string_view, Enumeration&); /// bool from_string(string_view, Enumeration&);
/// bool from_integer(std::underlying_type_t<Enumeration>, Enumeration&); /// bool from_integer(std::underlying_type_t<Enumeration>, Enumeration&);
/// ~~~ /// ~~~
template <class Inspector, class Enumeration> template <class Inspector, class Enumeration>
......
...@@ -131,7 +131,7 @@ class scoped_actor; ...@@ -131,7 +131,7 @@ class scoped_actor;
class serializer; class serializer;
class skip_t; class skip_t;
class stream_manager; class stream_manager;
class string_view; class [[deprecated("Use `std::string_view instead`")]] string_view;
class tracing_data; class tracing_data;
class tracing_data_factory; class tracing_data_factory;
class type_id_list; class type_id_list;
......
...@@ -51,8 +51,6 @@ struct is_string_like { ...@@ -51,8 +51,6 @@ struct is_string_like {
} // namespace detail } // namespace detail
class [[deprecated("Use `std::string_view instead`")]] string_view;
/// Drop-in replacement for C++17 std::string_view. /// Drop-in replacement for C++17 std::string_view.
class CAF_CORE_EXPORT string_view : detail::comparable<string_view> { class CAF_CORE_EXPORT string_view : detail::comparable<string_view> {
public: public:
......
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
private: private:
size_t name_length_; size_t name_length_;
std::string str_; std::string str_;
}; // namespace caf::telemetry };
/// Returns the @ref label in `name=value` notation. /// Returns the @ref label in `name=value` notation.
/// @relates label /// @relates label
......
...@@ -499,8 +499,7 @@ public: ...@@ -499,8 +499,7 @@ public:
config_ = ptr; config_ = ptr;
} }
// -- observers // -- observers --------------------------------------------------------------
// --------------------------------------------------------------
template <class Collector> template <class Collector>
void collect(Collector& collector) const { void collect(Collector& collector) const {
...@@ -510,8 +509,7 @@ public: ...@@ -510,8 +509,7 @@ public:
visit_family(f, ptr.get()); visit_family(f, ptr.get());
} }
// -- modifiers // -- modifiers --------------------------------------------------------------
// --------------------------------------------------------------
/// Takes ownership of all metric families in `other`. /// Takes ownership of all metric families in `other`.
/// @pre `other` *must not* contain any duplicated metric family /// @pre `other` *must not* contain any duplicated metric family
......
...@@ -317,4 +317,4 @@ std::ostream& operator<<(std::ostream& out, caf::string_view str) { ...@@ -317,4 +317,4 @@ std::ostream& operator<<(std::ostream& out, caf::string_view str) {
} // namespace std } // namespace std
CAF_POP_WARNINGS CAF_POP_WARNINGS
\ No newline at end of file
...@@ -67,8 +67,9 @@ CAF_TEST(config_consumer) { ...@@ -67,8 +67,9 @@ CAF_TEST(config_consumer) {
string_parser_state res{str.begin(), str.end()}; string_parser_state res{str.begin(), str.end()};
detail::parser::read_config(res, consumer); detail::parser::read_config(res, consumer);
CAF_CHECK_EQUAL(res.code, pec::success); CAF_CHECK_EQUAL(res.code, pec::success);
// TODO: empty constructor not present in std::string_view CAF_CHECK_EQUAL(std::string_view(std::addressof(*res.i),
// CAF_CHECK_EQUAL(std::string_view(res.i, res.e), std::string_view()); static_cast<size_t>(res.e - res.i)),
std::string_view());
CAF_CHECK_EQUAL(get_as<bool>(config, "is_server"), true); CAF_CHECK_EQUAL(get_as<bool>(config, "is_server"), true);
CAF_CHECK_EQUAL(get_as<uint16_t>(config, "port"), 4242u); CAF_CHECK_EQUAL(get_as<uint16_t>(config, "port"), 4242u);
CAF_CHECK_EQUAL(get_as<ls>(config, "nodes"), ls({"sun", "venus"})); CAF_CHECK_EQUAL(get_as<ls>(config, "nodes"), ls({"sun", "venus"}));
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
#define CAF_SUITE string_view #define CAF_SUITE string_view
#include "caf/string_view.hpp"
#include "core-test.hpp" #include "core-test.hpp"
#include "caf/string_view.hpp"
using namespace caf; using namespace caf;
using namespace caf::literals; using namespace caf::literals;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment