We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab2d339 commit 40a56aeCopy full SHA for 40a56ae
1 file changed
include/webcc/core/vector.h
@@ -53,6 +53,15 @@ namespace webcc
53
(push_back(static_cast<T>(rest)), ...);
54
}
55
56
+ template <typename InputIt, typename = enable_if_t<__is_pointer(InputIt)>>
57
+ vector(InputIt first, InputIt last)
58
+ {
59
+ for (; first != last; ++first)
60
61
+ push_back(static_cast<T>(*first));
62
+ }
63
64
+
65
explicit vector(size_t count)
66
{
67
resize(count);
@@ -326,6 +335,9 @@ namespace webcc
326
335
T *data() { return m_data; }
327
336
const T *data() const { return m_data; }
328
337
338
+ T &back() { return m_data[m_size - 1]; }
339
+ const T &back() const { return m_data[m_size - 1]; }
340
329
341
size_t size() const { return m_size; }
330
342
size_t capacity() const { return m_capacity; }
331
343
bool empty() const { return m_size == 0; }
0 commit comments