Template Function mir::raii::paired_calls

Function Documentation

template<typename Creator, typename Deleter>
inline auto mir::raii::paired_calls(Creator &&creator, Deleter &&deleter) -> std::unique_ptr<typename std::remove_reference<decltype(*creator())>::type, Deleter>

Creates an RAII object from a creator and deleter.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

If creator returns a pointer type then the returned object is a std::unique_ptr initialized with the pointer and deleter. Otherwise, the returned object calls creator on construction and deleter on destruction

Parameters:
  • creator – called to initialize the returned object

  • deleter – called to finalize the returned object