OpenTTD Source 20250703-master-gbf07751ee7
autorelease.hpp File Reference

Helper for std::unique_ptr to use an arbitrary function as the deleter. More...

Go to the source code of this file.

Data Structures

struct  DeleterFromFunc< Tfunc >
 Deleter that calls a function rather than deleting the pointer. More...
 

Typedefs

template<typename T , auto Tfunc>
using AutoRelease = std::unique_ptr< T, DeleterFromFunc< Tfunc > >
 Specialisation of std::unique_ptr for objects which must be deleted by calling a function.
 

Detailed Description

Helper for std::unique_ptr to use an arbitrary function as the deleter.

Definition in file autorelease.hpp.

Typedef Documentation

◆ AutoRelease

template<typename T , auto Tfunc>
using AutoRelease = std::unique_ptr<T, DeleterFromFunc<Tfunc> >

Specialisation of std::unique_ptr for objects which must be deleted by calling a function.

Definition at line 25 of file autorelease.hpp.