Skip to content

Commit

Permalink
Make pod_vector more compatible stl
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Feb 22, 2025
1 parent c36b7b2 commit a78c0d6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion yasio/pod_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Version: 4.1.1
Version: 4.3.2
The pod_vector aka array_buffer concepts:
a. The memory model is similar to to std::vector, but only accept trivially_copyable(no destructor & no custom copy constructor) types
Expand Down Expand Up @@ -255,11 +255,21 @@ class pod_vector {
_YASIO_VERIFY_RANGE(!empty(), "pod_vector: out of range!");
return *_Myfirst;
}
const value_type& front() const
{
_YASIO_VERIFY_RANGE(!empty(), "pod_vector: out of range!");
return *_Myfirst;
}
value_type& back()
{
_YASIO_VERIFY_RANGE(!empty(), "pod_vector: out of range!");
return _Myfirst[_Mysize - 1];
}
const value_type& back() const
{
_YASIO_VERIFY_RANGE(!empty(), "pod_vector: out of range!");
return _Myfirst[_Mysize - 1];
}
static YASIO__CONSTEXPR size_type max_size() YASIO__NOEXCEPT { return _Alloc_traits::max_size(); }
iterator begin() YASIO__NOEXCEPT { return _Myfirst; }
iterator end() YASIO__NOEXCEPT { return _Myfirst + _Mysize; }
Expand Down

0 comments on commit a78c0d6

Please sign in to comment.