Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 1.02 KB

get_first_last.md

File metadata and controls

49 lines (31 loc) · 1.02 KB

hal::get

Retrieve an element, via an index, from a parameter pack.

template <std::size_t I, typename... Elements>
decltype(auto) get(Elements&&... elements);

Returns a reference(l or r value) to the element at index I. Will fail to compile if I is out of range of the parameter pack.

hal::reverse::get(...)

❌ Modifying Algorithm

hal::first

Retrieve the first element from a parameter pack.

template <typename... Elements>
decltype(auto) first(Elements&&... elements);

Returns a reference(l or r value) to the first element. Will fail to compile if elements... is empty.

hal::reverse::first(...)

❌ Modifying Algorithm

hal::last

Retrieve the last element from a parameter pack.

template <typename... Elements>
decltype(auto) last(Elements&&... elements);

Returns a reference(l or r value) to the last element. Will fail to compile if elements... is empty.

hal::reverse::last(...)

❌ Modifying Algorithm

Examples