Skip to content

Commit

Permalink
[core] added empty() to vcl::Vector
Browse files Browse the repository at this point in the history
  • Loading branch information
malomo committed Jan 24, 2025
1 parent 7ef58b3 commit 8dac4dd
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -106,6 +106,7 @@ class PointerVector : protected Vector<T, N>
using Base::contains;
using Base::data;
using Base::erase;
using Base::empty;
using Base::fill;
using Base::find;
using Base::front;
Original file line number Diff line number Diff line change
@@ -98,6 +98,7 @@ class PolymorphicObjectVector : protected PointerVector<std::shared_ptr<T>, N>
using Base::contains;
using Base::data;
using Base::erase;
using Base::empty;
using Base::fill;
using Base::find;
using Base::front;
10 changes: 10 additions & 0 deletions vclib/core/include/vclib/space/core/vector/vector.h
Original file line number Diff line number Diff line change
@@ -579,6 +579,16 @@ class Vector
mContainer.emplace(mContainer.begin() + i, std::forward<Args>(args)...);
}

/**
* @brief Returns whether the vector is empty (i.e. whether its size is 0).
*
* @return `true` if the container size is 0, `false` otherwise.
*/
bool empty() const noexcept
{
return mContainer.empty();
}

/**
* @brief Remove the element at the specified index from the Vector.
*

0 comments on commit 8dac4dd

Please sign in to comment.