diff options
author | Moonchild <moonchild@palemoon.org> | 2023-10-18 14:35:59 +0200 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-11-05 13:16:39 +0100 |
commit | c87116b33267a8df388ca3652d211b7f8254a98d (patch) | |
tree | 8823d7815df612885a5769d6ede196b261041779 /mfbt | |
parent | e29ae4e08ccce7f120f8ee88dd238bd2b4facbf4 (diff) | |
download | uxp-c87116b33267a8df388ca3652d211b7f8254a98d.tar.gz |
Issue #2281 - Add some deduction guides for class template arguments.
This is necessary if we want to start using Span() constructors
instead of the MakeSpan() kludge.
Diffstat (limited to 'mfbt')
-rw-r--r-- | mfbt/Span.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mfbt/Span.h b/mfbt/Span.h index e71e068c60..fe679aa8bf 100644 --- a/mfbt/Span.h +++ b/mfbt/Span.h @@ -810,6 +810,15 @@ private: storage_type<span_details::extent_type<Extent>> storage_; }; +template <typename T, size_t Extent> +Span(T (&aArr)[Extent]) -> Span<T, Extent>; + +template <class Container> +Span(Container&) -> Span<typename Container::value_type>; + +template <class Container> +Span(const Container&) -> Span<const typename Container::value_type>; + // [Span.comparison], Span comparison operators template<class ElementType, size_t FirstExtent, size_t SecondExtent> inline bool |