Browse Source

containers: add insert_at() utility function.

wip/core-clipp
Sam Hocevar 4 years ago
parent
commit
7eb81936e2
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      include/lol/private/base/containers.h

+ 6
- 0
include/lol/private/base/containers.h View File

@@ -51,6 +51,12 @@ static inline std::vector<typename T::key_type> keys(T const &m)
return ret;
}

template <typename T>
static inline auto insert_at(std::vector<T> &v, size_t i, T const &x)
{
return v.insert(v.begin() + i, x);
}

template <typename T>
static inline auto remove_at(std::vector<T> &v, size_t i)
{


Loading…
Cancel
Save