Support for getting C array data from List.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
7c98d3d4eb
commit
ba586bf262
|
@ -1,9 +1,9 @@
|
|||
#ifndef ARBUTILS_LIST_HPP
|
||||
#define ARBUTILS_LIST_HPP
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
namespace Arbutils::Collections {
|
||||
template <class ValueT> class List {
|
||||
|
@ -16,9 +16,7 @@ namespace Arbutils::Collections {
|
|||
explicit List(size_t capacity) : _vector(capacity) {}
|
||||
List(const std::initializer_list<ValueT>& l) : _vector(l) {}
|
||||
|
||||
inline void Clear(){
|
||||
_vector.clear();
|
||||
}
|
||||
inline void Clear() { _vector.clear(); }
|
||||
|
||||
inline const ValueT& At(size_t index) const {
|
||||
#ifndef NO_ASSERT
|
||||
|
@ -41,9 +39,7 @@ namespace Arbutils::Collections {
|
|||
return _vector.at(index);
|
||||
}
|
||||
|
||||
inline bool Contains(ValueT value){
|
||||
return std::find(_vector.begin(), _vector.end(), value) != _vector.end();
|
||||
}
|
||||
inline bool Contains(ValueT value) { return std::find(_vector.begin(), _vector.end(), value) != _vector.end(); }
|
||||
|
||||
inline void Append(ValueT value) { _vector.push_back(value); }
|
||||
|
||||
|
@ -54,12 +50,13 @@ namespace Arbutils::Collections {
|
|||
|
||||
inline size_t Count() { return _vector.size(); }
|
||||
|
||||
|
||||
iterator begin() { return _vector.begin(); }
|
||||
iterator begin() const { return _vector.begin(); }
|
||||
|
||||
iterator end() { return _vector.end(); }
|
||||
iterator end() const { return _vector.end(); }
|
||||
|
||||
const ValueT* RawData() const { return _vector.data(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue