• fxomt@lemm.ee
    link
    fedilink
    English
    arrow-up
    37
    ·
    edit-2
    1 day ago
    #include <vector>
    #include <algorithm>
    
    int main() {
        int a;
        std::vector<std::vector<int>> v;
        std::vector<std::vector<int>>::const_iterator it = std::find(v.begin(), v.end(), a);
    }
    

    assaults you with 42 errors, C++ templates are a joy 😊

      • Traister101@lemmy.today
        link
        fedilink
        arrow-up
        14
        ·
        1 day ago

        Uninitalized memory (int a; with no assignment) vector of int vectors (IE a dynamic int[][]) and attempting to find a, an int in the vector of vectors of int IE int instead of vector<int>. I think the iterator type is correct but I’m not sure off the top of my head