Bug 176228
| Summary: | std::optional<Ref> should be as compact as RefPtr | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Filip Pizlo <fpizlo> |
| Component: | Web Template Framework | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | achristensen, cdumez, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | All | ||
| OS: | All | ||
Filip Pizlo
This seems like something we could specialize.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alex Christensen
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
(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
(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).