From 3e262f6aef7f682d38966d41f81382052b016596 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 15 Feb 2022 13:20:33 +1000 Subject: [PATCH] uri: constructors should be explicit --- test/uri.cpp | 2 +- uri.hpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/uri.cpp b/test/uri.cpp index 72199a41..95c65d79 100644 --- a/test/uri.cpp +++ b/test/uri.cpp @@ -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); diff --git a/uri.hpp b/uri.hpp index c84a1b2f..2b4deb85 100644 --- a/uri.hpp +++ b/uri.hpp @@ -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); + explicit uri (const std::string&); + explicit uri (const char *); + explicit uri (view); uri ( std::string_view scheme,