Fix comments, reenable config_consumer test

parent 04f71904
......@@ -115,8 +115,8 @@ private:
/// 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
/// the match and a `caf::std::string_view` of the option value if the entry is
/// found and a `ForwardIterator` to `last` with an empty `std::string_view`
/// the match and a `string_view` of the option value if the entry is
/// found and a `ForwardIterator` to `last` with an empty `string_view`
/// otherwise.
template <class ForwardIterator, class Sentinel>
std::pair<ForwardIterator, std::string_view>
......
......@@ -500,7 +500,7 @@ expected<T> get_as(const config_value& value) {
/// Customization point for configuring automatic mappings from default value
/// 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
/// `caf`.
template <class T>
......
......@@ -19,7 +19,7 @@ namespace caf {
/// ~~~(cpp)
/// enum class 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&);
/// ~~~
template <class Inspector, class Enumeration>
......
......@@ -131,7 +131,7 @@ class scoped_actor;
class serializer;
class skip_t;
class stream_manager;
class string_view;
class [[deprecated("Use `std::string_view instead`")]] string_view;
class tracing_data;
class tracing_data_factory;
class type_id_list;
......
......@@ -51,8 +51,6 @@ struct is_string_like {
} // namespace detail
class [[deprecated("Use `std::string_view instead`")]] string_view;
/// Drop-in replacement for C++17 std::string_view.
class CAF_CORE_EXPORT string_view : detail::comparable<string_view> {
public:
......
......@@ -58,7 +58,7 @@ public:
private:
size_t name_length_;
std::string str_;
}; // namespace caf::telemetry
};
/// Returns the @ref label in `name=value` notation.
/// @relates label
......
......@@ -499,8 +499,7 @@ public:
config_ = ptr;
}
// -- observers
// --------------------------------------------------------------
// -- observers --------------------------------------------------------------
template <class Collector>
void collect(Collector& collector) const {
......@@ -510,8 +509,7 @@ public:
visit_family(f, ptr.get());
}
// -- modifiers
// --------------------------------------------------------------
// -- modifiers --------------------------------------------------------------
/// Takes ownership of all metric families in `other`.
/// @pre `other` *must not* contain any duplicated metric family
......
......@@ -67,8 +67,9 @@ CAF_TEST(config_consumer) {
string_parser_state res{str.begin(), str.end()};
detail::parser::read_config(res, consumer);
CAF_CHECK_EQUAL(res.code, pec::success);
// TODO: empty constructor not present in std::string_view
// CAF_CHECK_EQUAL(std::string_view(res.i, res.e), std::string_view());
CAF_CHECK_EQUAL(std::string_view(std::addressof(*res.i),
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<uint16_t>(config, "port"), 4242u);
CAF_CHECK_EQUAL(get_as<ls>(config, "nodes"), ls({"sun", "venus"}));
......
......@@ -4,10 +4,10 @@
#define CAF_SUITE string_view
#include "caf/string_view.hpp"
#include "core-test.hpp"
#include "caf/string_view.hpp"
using namespace caf;
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