summaryrefslogtreecommitdiff
path: root/indra/test
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-06-05 23:46:43 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-06-05 23:46:43 -0400
commit26ca3e14d623e4094dde76ad88e3da2a209483b5 (patch)
treeb9ef0f78eb17d1273ade2337b39e9860e60aa0af /indra/test
parentaab769e9d7a9b11256572f8adb69d586d9ff8d3d (diff)
SL-18837: NamedTempFile must still disambiguate string literals.
Diffstat (limited to 'indra/test')
-rw-r--r--indra/test/namedtempfile.h14
1 files changed, 14 insertions, 0 deletions
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))
{}