[cplusplus] Internally allow using hb_unique_ptr with hb_free()

...for arbitrary types.
pull/3639/head
Behdad Esfahbod 3 years ago
parent f18eb000d3
commit b5f621b08d
  1. 15
      src/hb.hh

@ -466,10 +466,23 @@ static_assert ((sizeof (hb_mask_t) == 4), "");
static_assert ((sizeof (hb_var_int_t) == 4), "");
#include "hb-cplusplus.hh"
namespace hb {
// Allow using hb::unique_ptr with hb_free() internally.
template <typename T>
struct vtable
{
static constexpr auto destroy = hb_free;
};
}
/* Headers we include for everyone. Keep topologically sorted by dependency.
* They express dependency amongst themselves, but no other file should include
* them directly.*/
#include "hb-cplusplus.hh"
#include "hb-meta.hh"
#include "hb-mutex.hh"
#include "hb-number.hh"

Loading…
Cancel
Save