소스 검색

containers: add insert_at() utility function.

wip/core-clipp
Sam Hocevar 5 년 전
부모
커밋
7eb81936e2
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. +6
    -0
      include/lol/private/base/containers.h

+ 6
- 0
include/lol/private/base/containers.h 파일 보기

@@ -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)
{


불러오는 중...
취소
저장