C++Now 2018: Jason Turner “Initializer Lists Are Broken, Let's Fix Them”

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024

ความคิดเห็น • 13

  • @denisyaroshevskiy5679
    @denisyaroshevskiy5679 6 ปีที่แล้ว +2

    33m : you can do better then emplace_back by using memcpy for trivially copiable types.
    Also In my measurements checks for capacity in push back don't go away.

  • @Predelnik
    @Predelnik 6 ปีที่แล้ว +2

    So basically lack of partial template deduction for classes makes make_array function better than std::array constructor.

    • @N....
      @N.... หลายเดือนก่อน

      Actually no, since any make_array function still has to forward the arguments, whereas std::array has no constructors so they can be constructed in-place

  • @akarshy
    @akarshy 4 ปีที่แล้ว +1

    lmao the people in the audience

  • @llothar68
    @llothar68 6 ปีที่แล้ว +6

    Sorry guys, i'm going back to C with classes, meaning i'm using C++ with a very very limited amount of ++ extensions.

    • @nexusclarum8000
      @nexusclarum8000 5 ปีที่แล้ว +3

      Yeah, and you'll get yourself into constructor hell. The whole language is broken. I'm so close to just going to C tbh lol.

    • @lincolnsand5127
      @lincolnsand5127 4 ปีที่แล้ว +7

      "C" and "C with Classes" are shitty and unsafe. Most of the broken shit in C++ is because of the broken shit in C. Modern C++ & Rust are the future, just let "C" & "C with Classes" die.

    • @Neme112
      @Neme112 6 หลายเดือนก่อน

      @@lincolnsand5127 "Most of the broken shit in C++ is because of the broken shit in C" No. The most shitty thing about C++ is how easily you can make a deep copy of an object accidentally and allocate a new one, and how hard it is to be able to tell when that happens and when it doesn't and you can't really reason about it. That's not a problem that comes from C, you will never accidentally do a deep copy of a string in C. That's a C++ problem.

  • @wizardy6267
    @wizardy6267 6 ปีที่แล้ว

    Is this the talk that is been referred @5:00? th-cam.com/video/O50qTuM5OT0/w-d-xo.html

  • @maximkosheleff
    @maximkosheleff 6 ปีที่แล้ว

    16:50 std::size !!!!

  • @Silmarieni1
    @Silmarieni1 6 ปีที่แล้ว +1

    Would have preferred examples where initializer lists are broken when used in non-contrived real life code

    • @Predelnik
      @Predelnik 6 ปีที่แล้ว +21

      So vector is not real life code?