-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a bit more content for #298 tests.
- Loading branch information
Showing
3 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
namespace testutils | ||
{ | ||
template<typename VecType> | ||
std::vector<VecType>& multi_emplace(std::vector<VecType>& vec) | ||
{ | ||
return vec; | ||
} | ||
|
||
template<typename VecType> | ||
std::vector<VecType>&& multi_emplace(std::vector<VecType>&& vec) | ||
{ | ||
return std::move(vec); | ||
} | ||
|
||
template<typename VecType, typename Head, typename... Tail> | ||
std::vector<VecType>& multi_emplace(std::vector<VecType>& vec, Head&& head, Tail&&... tail) | ||
{ | ||
vec.emplace_back(std::move(head)); | ||
return multi_emplace(vec, tail...); | ||
} | ||
|
||
template<typename VecType, typename Head, typename... Tail> | ||
std::vector<VecType>&& multi_emplace(std::vector<VecType>&& vec, Head&& head, Tail&&... tail) | ||
{ | ||
vec.emplace_back(std::move(head)); | ||
return std::move(multi_emplace(vec, tail...)); | ||
} | ||
} |