Hacker News new | past | comments | ask | show | jobs | submit login

    template <typename T>
    void remove(std::vector<T>& v, std::size_t i)
    {
        std::swap(v[i], v.back());
        v.resize(v.size() - 1);
    }



That's just a different algorithm that produces different results than .erase() and has nothing to do with cache.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: