From 0d3d5b62ae9988695627db7f8b2d4fde044c8778 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 2 Jun 2022 08:00:08 -0600 Subject: [PATCH] [cplusplus] Adjustments --- src/hb-cplusplus.hh | 8 +++++++- src/test-map.cc | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hb-cplusplus.hh b/src/hb-cplusplus.hh index 39b150fea..9bda38c47 100644 --- a/src/hb-cplusplus.hh +++ b/src/hb-cplusplus.hh @@ -49,9 +49,10 @@ struct vtable; template struct shared_ptr { + using element_type = T; + using v = vtable; - shared_ptr (std::nullptr_t) : p (nullptr) {} explicit shared_ptr (T *p = nullptr) : p (p) {} shared_ptr (const shared_ptr &o) : p (v::reference (o.p)) {} shared_ptr (shared_ptr &&o) : p (o.p) { o.p = nullptr; } @@ -84,6 +85,11 @@ struct shared_ptr T *p; }; +template struct is_shared_ptr : std::false_type {}; +template struct is_shared_ptr> : std::true_type {}; + +// TODO Implement hash<> and atomic<> + template ()); +#if 0 { hb_hashmap_t, hb::shared_ptr, std::nullptr_t, std::nullptr_t, nullptr, nullptr> m; - hb_hash (hb::shared_ptr ()); m.get (hb::shared_ptr ()); m.get (hb::shared_ptr (hb_set_get_empty ())); } +#endif return 0; }