template <class Smart, class Pointer, class... Args>
class out_ptr_t {
public:
// 20.11.9.1, constructors
explicit out_ptr_t(Smart&, Args...);
out_ptr_t(const out_ptr_t&) = delete;
// 20.11.9.2, destructors
~out_ptr_t();
// 20.11.9.3, conversion operators
operator Pointer*() const noexcept;
operator void**() const noexcept;
private:
Smart& s; // exposition only
tuple<Args...> a; // exposition only
Pointer p; // exposition only
};
I could see plenty of utility in adding an additional operator Pointer*& that would support legacy C++ api's (e.g., factory methods) that assigned to output pointers by lvalue reference.