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) {
cruft::uri const relative_obj (relative);
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)
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.
class uri {
public:
uri (std::string &&);
explicit uri (std::string &&);
uri& operator= (uri &&) noexcept;
uri (uri const&);
uri& operator= (uri const&);
uri (const std::string&);
uri (const char *);
uri (view<const char *>);
explicit uri (const std::string&);
explicit uri (const char *);
explicit uri (view<const char *>);
uri (
std::string_view scheme,