template<size_t Count> constexpr span<element_type, Count> first() const;
-1- Mandates:
Count <= Extent
istrue
.-2- Hardened preconditions:
Count <= size()
istrue
.-3- Effects: Equivalent to:
return R ( {data(), Count } );
whereR
is the return type.
template<size_t Count> constexpr span<element_type, Count> last() const;
-4- Mandates:
Count <= Extent
istrue
.-5- Hardened preconditions:
Count <= size()
istrue
.-6- Effects: Equivalent to:
return R ( {data() + (size() - Count), Count } );
whereR
is the return type.
template<size_t Offset, size_t Count = dynamic_extent>
constexpr span<element_type, see below> subspan() const;
-7- Mandates:
isOffset <= Extent && (Count == dynamic_extent || Count <= Extent - Offset)
true
.-8- Hardened preconditions:
isOffset <= size() && (Count == dynamic_extent || Count <= size() - Offset)
true
.-9- Effects: Equivalent to:
return span<ElementType, see below>( data() + Offset, Count != dynamic_extent ? Count : size() - Offset);
-10- Remarks: The second template argument of the returned
span
type is:Count != dynamic_extent ? Count : (Extent != dynamic_extent ? Extent - Offset : dynamic_extent)
constexpr span<element_type, dynamic_extent> first(size_type count) const;
-11- Hardened preconditions:
count <= size()
istrue
.-12- Effects: Equivalent to:
return R( {data(), count } );
whereR
is the return type.
constexpr span<element_type, dynamic_extent> last(size_type count) const;
-13- Hardened preconditions:
count <= size()
istrue
.-14- Effects: Equivalent to:
return R( {data() + (size() - count), count } );
whereR
is the return type.
constexpr span<element_type, dynamic_extent> subspan(
size_type offset, size_type count = dynamic_extent) const;
-15- Hardened preconditions:
isoffset <= size() && (count == dynamic_extent || count <= size() - offset
true
.-16- Effects: Equivalent to:
wherereturn R({data() + offset, count == dynamic_extent ? size() - offset : count});
R
is the return type.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4