add s_multiset
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
namespace hack::container
|
||||
{
|
||||
template<typename Range, typename... Args>
|
||||
void v_multiset(Range& r, Args... args)
|
||||
{
|
||||
std::size_t t = sizeof... (args);
|
||||
constexpr std::size_t t = sizeof... (args);
|
||||
r.reserve(t);
|
||||
(r.emplace_back(std::forward<Args>(args)), ...);
|
||||
}
|
||||
|
||||
template<typename Range, typename... Args>
|
||||
void s_multiset(Range& r, Args... args)
|
||||
{
|
||||
(r.insert(args), ...);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "string.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace hack::string
|
||||
{
|
||||
v_str split_str(const std::string& str, char t)
|
||||
@@ -15,9 +17,7 @@ namespace hack::string
|
||||
begin = ++end;
|
||||
end = str.find_first_of(t, begin);
|
||||
}
|
||||
|
||||
v.emplace_back(str.substr(begin));
|
||||
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user