@@ -26,6 +26,7 @@ namespace Common {
2626 template <typename T> static size_t SwapWithLastAndDelete (std::vector<T>& vector, size_t index);
2727 template <typename T> static std::vector<T> GetIntersection (const std::vector<T>& lhs, const std::vector<T>& rhs);
2828 template <typename T> static std::vector<T> GetDifferences (const std::vector<T>& lhs, const std::vector<T>& rhs);
29+ template <typename T> static std::vector<T> Combine (const std::vector<T>& lhs, const std::vector<T>& rhs);
2930 };
3031
3132 class SetUtils {
@@ -335,6 +336,15 @@ namespace Common {
335336 return result;
336337 }
337338
339+ template <typename T>
340+ std::vector<T> VectorUtils::Combine (const std::vector<T>& lhs, const std::vector<T>& rhs)
341+ {
342+ std::vector<T> result;
343+ result.insert (result.end (), lhs.begin (), lhs.end ());
344+ result.insert (result.end (), rhs.begin (), rhs.end ());
345+ return result;
346+ }
347+
338348 template <typename T>
339349 std::unordered_set<T> SetUtils::GetIntersection (const std::unordered_set<T>& lhs, const std::unordered_set<T>& rhs)
340350 {
@@ -669,7 +679,7 @@ namespace Common {
669679 } else if constexpr (std::is_copy_assignable_v<T>) {
670680 TypedMemory (i) = TypedMemory (i + 1 );
671681 } else {
672- Assert ( false );
682+ QuickFail ( );
673683 }
674684 }
675685 InplaceDestruct (size - 1 );
@@ -699,7 +709,7 @@ namespace Common {
699709 } else if constexpr (std::is_copy_assignable_v<T>) {
700710 TypedMemory (inIndex) = TypedMemory (size - 1 );
701711 } else {
702- Assert ( false );
712+ QuickFail ( );
703713 }
704714 InplaceDestruct (size - 1 );
705715 size--;
@@ -934,15 +944,15 @@ namespace Common {
934944 } else if constexpr (std::is_copy_constructible_v<T>) {
935945 InplaceConstruct (i, TypedMemory (i - 1 ));
936946 } else {
937- Assert ( false );
947+ QuickFail ( );
938948 }
939949 } else {
940950 if constexpr (std::is_move_assignable_v<T>) {
941951 TypedMemory (i) = std::move (TypedMemory (i - 1 ));
942952 } else if constexpr (std::is_copy_assignable_v<T>) {
943953 TypedMemory (i) = TypedMemory (i - 1 );
944954 } else {
945- Assert ( false );
955+ QuickFail ( );
946956 }
947957 }
948958 }
0 commit comments