예제 #1
0
static auto getStrongIdRange2(std::size_t s, const Vector1& existing1, const Vector2& existing2)
{
    std::vector<Id<T>> vec;
    vec.reserve(s + existing1.size() + existing2.size());
    std::transform(existing1.begin(), existing1.end(), std::back_inserter(vec),
                   [] (const auto& elt) { return elt.id(); });
    std::transform(existing2.begin(), existing2.end(), std::back_inserter(vec),
                   [] (const auto& elt) { return elt->id(); });

    for(; s --> 0 ;)
    {
        vec.push_back(getStrongId(vec));
    }
    auto final = std::vector<Id<T>>(vec.begin() + existing1.size() + existing2.size(), vec.end());

    return final;
}
bool CheckEqualVector(const Vector1 &vector1, const Vector2 &vector2)
{
   if(vector1.size() != vector2.size())
      return false;
   return std::equal(vector1.begin(), vector1.end(), vector2.begin());
}