![]() |
Home | Libraries | People | FAQ | More |
Return a pointer to an element, or nullptr if the index is invalid.
valueconst* if_contains(std::size_tpos) const noexcept;
This function returns a pointer to the element at index pos when the index is less then the
size of the container. Otherwise it returns null.
if( auto p = arr.if_contains( 1 ) ) std::cout << *p;
Constant.
No-throw guarantee.
|
Name |
Description |
|---|---|
|
|
The index of the element to return. |