The Care and Feeding of C++’s Dragons

Sign in to queue

The Discussion

  • User profile image
    OleJak

    No video block=(

  • User profile image
    vittoriorom​eo

    Thank you Chandler for this amazing talk, and thanks to everyone who works on Clang. LLVM is my favorite toolchain, and the sanitizers saved my butt countless times! Big Smile

  • User profile image
    Steve

    int sum(const std::vector<int> &numbers) {
    int result = 0;
    for (std::vector<int>::const_iterator it = numbers.begin();
    it != numbers.end(); ++it) {
    result += *it;
    }
    return result;
    }

    Instead of the range-based for fix to help the compiler optimizer with 'numbers.end()'
    for (const auto &number : numbers) {
    result += number;
    }

    As an alternative could this also fix the problem?
    int sum(const std::vector<int> &numbers) {
    int result = 0;
    std::vector<int>::const_iterator it_end = numbers.end();
    for (std::vector<int>::const_iterator it = numbers.begin();
    it != it_end; ++it) {
    result += *it;
    }
    return result;
    }

  • User profile image
    Ben Hanson

    @Steve: Yes, but the point was lots of people don't bother to do that.

  • User profile image
    tomkirbygre​en

    I would love to know Chandler's recommendation for a 'Clang based' experimental sandpit. Even if it is Linux based. Any chance of getting a brief coding environment description from Chandler?

  • User profile image
    trandatnh

    Really amazing talk Chandler. I'm going to using Clang and these utilities after this talk. Thank you :)

  • User profile image
    Charles

    clang on Windows! Smiley

    Whole lot of awesome.

    C

  • User profile image
    Mads Ravn

    This might be an off-topic question, but how is he able to travel the output of his programs with his cursor like he is in an editor?

  • User profile image
    Kris

    He is using a program call tmux

  • User profile image
    Alexander Chertov

    Would be useful if you could run dynamic analysis alongside a debugger: break into debugger on invalid memory access. Just easier to understand the conditions under which the problem happens. Visual C++ has something like that and it's super useful.

Add Your 2 Cents