uri: constructors should be explicit

This commit is contained in:
Danny Robson 2022-02-15 13:20:33 +10:00
parent ceda32b912
commit 3e262f6aef
2 changed files with 5 additions and 5 deletions

View File

@ -287,7 +287,7 @@ test_rfc_resolve (cruft::TAP::logger &tap)
for (auto const [relative, expected]: TESTS) { for (auto const [relative, expected]: TESTS) {
cruft::uri const relative_obj (relative); cruft::uri const relative_obj (relative);
cruft::uri const expected_obj (expected); cruft::uri const expected_obj (expected);
cruft::uri const resolved_obj = resolve (base, relative); cruft::uri const resolved_obj = resolve (base, cruft::uri (relative));
if (resolved_obj != expected_obj) if (resolved_obj != expected_obj)
fmt::print (stderr, "# '{}' != '{}'\n", expected_obj, resolved_obj); fmt::print (stderr, "# '{}' != '{}'\n", expected_obj, resolved_obj);

View File

@ -34,15 +34,15 @@ namespace cruft {
// any given protocol). eg, the "tel" is unlikely to have port numbers. // any given protocol). eg, the "tel" is unlikely to have port numbers.
class uri { class uri {
public: public:
uri (std::string &&); explicit uri (std::string &&);
uri& operator= (uri &&) noexcept; uri& operator= (uri &&) noexcept;
uri (uri const&); uri (uri const&);
uri& operator= (uri const&); uri& operator= (uri const&);
uri (const std::string&); explicit uri (const std::string&);
uri (const char *); explicit uri (const char *);
uri (view<const char *>); explicit uri (view<const char *>);
uri ( uri (
std::string_view scheme, std::string_view scheme,