• [^] # Re: smart pointer

    Posté par (site web personnel) . En réponse au journal Retour aux sources. Évalué à 4.

    texitoi@vaio:~/dev/tests$ cat test.cpp
    #include <iostream>
    #include <vector>
    int main() {
     std::vector<int> v {0,1,2,3};
     for (int i: v) std::cout << i << " ";
     std::cout << std::endl;
     return 0;
    }
    texitoi@vaio:~/dev/tests$ clang++ -g -std=c++11 -Weverything -Wno-c++98-compat test.cpp -o test
    texitoi@vaio:~/dev/tests$ gdb -q ./test 
    Reading symbols from ./test...done.
    (gdb) b test.cpp:6
    Breakpoint 1 at 0x400d25: file test.cpp, line 6.
    (gdb) r
    Starting program: /home/texitoi/dev/tests/test 
    Breakpoint 1, main () at test.cpp:6
    6 for (int i: v) std::cout << i << " ";
    (gdb) p v
    1ドル = std::vector of length 4, capacity 4 = {0, 1, 2, 3}
    (gdb) 
    

    Mais c'est vrai que ça fait pas longtemps que Debian configure correctement gdb par défaut.