From 26ca3e14d623e4094dde76ad88e3da2a209483b5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 5 Jun 2023 23:46:43 -0400 Subject: SL-18837: NamedTempFile must still disambiguate string literals. --- indra/test/namedtempfile.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/test') diff --git a/indra/test/namedtempfile.h b/indra/test/namedtempfile.h index df7495fc13..acfc048b7a 100644 --- a/indra/test/namedtempfile.h +++ b/indra/test/namedtempfile.h @@ -38,6 +38,15 @@ public: createFile(pfx, [&content](std::ostream& out){ out << content; }, sfx); } + // Disambiguate when passing string literal -- unclear why a string + // literal should be ambiguous wrt std::string_view and Streamer + NamedTempFile(const std::string_view& pfx, + const char* content, + const std::string_view& sfx=std::string_view("")) + { + createFile(pfx, [&content](std::ostream& out){ out << content; }, sfx); + } + // Function that accepts an ostream ref and (presumably) writes stuff to // it, e.g.: // (boost::phoenix::placeholders::arg1 << "the value is " << 17 << '\n') @@ -99,6 +108,11 @@ public: NamedTempFile(remove_dot(ext), content, ensure_dot(ext)) {} + // Disambiguate when passing string literal + NamedExtTempFile(const std::string& ext, const char* content): + NamedTempFile(remove_dot(ext), content, ensure_dot(ext)) + {} + NamedExtTempFile(const std::string& ext, const Streamer& func): NamedTempFile(remove_dot(ext), func, ensure_dot(ext)) {} -- cgit v1.2.3