input/InputStream: allow emplacing the URI

This commit is contained in:
Max Kellermann 2023-01-23 14:02:52 +01:00
parent cd2aaac0c2
commit 5ca74acd8d
2 changed files with 8 additions and 6 deletions

View File

@ -33,10 +33,11 @@ class FailingInputStream final : public InputStream {
const std::exception_ptr error; const std::exception_ptr error;
public: public:
explicit FailingInputStream(const char *_uri, template<typename U>
explicit FailingInputStream(U &&_uri,
const std::exception_ptr _error, const std::exception_ptr _error,
Mutex &_mutex) noexcept Mutex &_mutex) noexcept
:InputStream(_uri, _mutex), error(_error) { :InputStream(std::forward<U>(_uri), _mutex), error(_error) {
SetReady(); SetReady();
} }

View File

@ -94,10 +94,11 @@ private:
std::string mime; std::string mime;
public: public:
InputStream(const char *_uri, Mutex &_mutex) noexcept template<typename U>
:uri(_uri), InputStream(U &&_uri, Mutex &_mutex) noexcept
mutex(_mutex) { :uri(std::forward<U>(_uri)),
assert(_uri != nullptr); mutex(_mutex)
{
} }
/** /**