return *this;
}
+ ptrdiff_t operator-(const _iterator& other) const
+ {
+ return _index - other._index;
+ }
+
bool operator==(const _iterator& other) const noexcept
{
return _index == other._index;
return ContainerOperations::size(_container);
}
+ bool empty() const
+ {
+ return size() == 0;
+ }
+
typename std::conditional<std::is_pointer<ElementType>::value, ElementType, ElementType&>::type
operator[](std::size_t index)
{
*
* For more information, see Item 3 of Effective C++.
*/
- const auto& const_this = static_cast<const decltype(*this)&>(*this);
+ const auto& const_this = static_cast<const random_access_container_wrapper&>(*this);
/* NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast) */
return const_cast<typename std::conditional<std::is_pointer<ElementType>::value,
operator[](std::size_t index) const
{
if (index >= ContainerOperations::size(_container)) {
- LTTNG_THROW_INVALID_ARGUMENT_ERROR(lttng::format(
+ throw std::invalid_argument(lttng::format(
"Out of bound access through random_access_container_wrapper: index={}, size={}",
index,
size()));