NEW 176228
std::optional<Ref> should be as compact as RefPtr
https://bugs.webkit.org/show_bug.cgi?id=176228
Summary std::optional<Ref> should be as compact as RefPtr
Filip Pizlo
Reported 2017-09-01 10:14:10 PDT
This seems like something we could specialize.
Attachments
Alex Christensen
Comment 1 2017-09-01 11:02:46 PDT
Can we make the specialization copyable like RefPtr is? If we make a specialization of std::optional<Ref<T>> with the intent of saving memory, should we make similar specializations of std::optional<T&> and std::optional<bool>?
Filip Pizlo
Comment 2 2017-09-01 11:03:48 PDT
(In reply to Alex Christensen from comment #1) > Can we make the specialization copyable like RefPtr is? > If we make a specialization of std::optional<Ref<T>> with the intent of > saving memory, should we make similar specializations of std::optional<T&> > and std::optional<bool>? I would use std::optional more if I had such specializations.
Yusuke Suzuki
Comment 3 2017-09-01 21:27:05 PDT
(In reply to Alex Christensen from comment #1) > Can we make the specialization copyable like RefPtr is? > If we make a specialization of std::optional<Ref<T>> with the intent of > saving memory, should we make similar specializations of std::optional<T&> > and std::optional<bool>? We already have std::optional<T&> specialization in Optional.h. I would like to strongly support adding std::optional<bool>, which is super commonly shown pattern (tristate).
Note You need to log in before you can comment on or make changes to this bug.