Testing code may create a temporary [rvalue] stream, and it would be nice to not have to make it a named variable [lvalue], but this doesn’t work with just the above function: add_from_stream( std::stringstream(some_string_data) ); // ERROR, can't pass rvalue to A's parameter So I want to add an overload that takes an rvalue reference, like this: void add_from_stream( std::istream &&s ); // B // now the above call would work and call B // Option 3(a): Single function, takes lvalue and rvalue streams template <typename S> void add_from_stream( S&& s ) requires std::is_same_v<S, std::istream> { // do work + remember to use s as "std::forward<S>(s)" } // Option 3(b): Single function, takes lvalue and rvalue streams template <typename S> void add_from_stream( S&& s ) requires…