SL-18837: NamedTempFile must still disambiguate string literals.
parent
aab769e9d7
commit
26ca3e14d6
|
|
@ -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))
|
||||
{}
|
||||
|
|
|
|||
Loading…
Reference in New Issue