drop array
This commit is contained in:
@@ -1,11 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/basicTypes.h"
|
||||
#include <utility>
|
||||
|
||||
unsigned strLen(const char* str);
|
||||
void strCopy(char *to, const char* from);
|
||||
bool strComp(const char* firts, const char* second); //0 - diffrent 1 - same
|
||||
char* mergeStr(const char* first, const char* second);
|
||||
template <class Vec> inline
|
||||
Vec& operator+=(Vec& lhs, Vec&& rhs) // Combine 2 vectors
|
||||
{
|
||||
lhs.reserve(lhs.size() + rhs.size());
|
||||
|
||||
for(auto& el: rhs)
|
||||
lhs.push_back( std::forward<decltype(el)>(el) );
|
||||
return lhs;
|
||||
}
|
||||
|
||||
template <class Vec> inline
|
||||
Vec& operator+=(Vec& lhs, const Vec& rhs) // Combine 2 vectors
|
||||
{
|
||||
lhs.reserve(lhs.size() + rhs.size());
|
||||
|
||||
for(const auto& el: rhs)
|
||||
lhs.push_back( std::forward<decltype(el)>(el) );
|
||||
return lhs;
|
||||
}
|
||||
|
||||
template <class Vec> inline
|
||||
void remove(Vec& vec, size_t pos) /* Remove from vector by moving the last element in its place */
|
||||
{
|
||||
vec[pos] = vec[vec.size() - 1];
|
||||
vec.pop_back();
|
||||
}
|
||||
|
||||
inline I32 max(I32 a, I32 b)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user