C++ Weekly - Ep 178 - The Important Parts of C++14 In 9 Minutes

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

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

  • @thestarinthesky_
    @thestarinthesky_ ปีที่แล้ว

    @2:41 I think it should be std::count_if instead of std::count when used with lambda or it won't compile. Thanks Jason great video!

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

    There are still plenty of cases where you want to use new and delete to deal with memory directly. For example, writing a general purpose memory pool to prevent fragmentation and cache line misses.

  • @dawidwdowiak6518
    @dawidwdowiak6518 5 ปีที่แล้ว +8

    Great video as always. No longer need to explicitly put new`s or delete`s, unless you work with Qt, then there are bunch of new's and no delete's. Looking for memory leaks is like, where did I lose parent-child relationship.

  • @danielphd5072
    @danielphd5072 5 ปีที่แล้ว +8

    Thank you for this new video about C++ 14 #cpp #cplusplus 14

  • @dshvets1
    @dshvets1 ปีที่แล้ว

    Great video. One more useful helper function introduced in C++14 is - std::quoted().

  • @connorhorman
    @connorhorman 5 ปีที่แล้ว +9

    No longer need to explicitly put `new` or `delete` in code, unless you want to write a custom form of automatic memory management with custom semantics.

    • @DamianReloaded
      @DamianReloaded 5 ปีที่แล้ว +2

      That is, you want the ultimate speedz, implementing a pool or something. I understand make_unique can't be optimized away cause it throws?

    • @connorhorman
      @connorhorman 5 ปีที่แล้ว

      Damian Reloaded Or like a specialized version of unique_ptr.
      For example, my PolymorphicWrapper class allows you to store values of a Polymorphic type, including subclass objects, without slicing as well as in-place construction. Its unspecified how it achieves this, but in practice I just use plain new/delete. I just use that here in case I want to move to having an SBO implementation, and need a raw pointer.

  • @npetrenko97
    @npetrenko97 5 ปีที่แล้ว

    The problem with make_unique and friends is that they don't allow template argument deduction. For me it is critical -- I've got used to tag-dispatching constructors implemented through user-defined deduction guides

  • @thestarinthesky_
    @thestarinthesky_ ปีที่แล้ว

    @5:59 Does anyone know what the word 'fording' is? "Now it is relatively easy, using variadic templates and *fording* and move semantics that were added in C++ 11? what is 'fording'?

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

      It's forwarding, not fording. Sorry if that was unclear.

    • @thestarinthesky_
      @thestarinthesky_ ปีที่แล้ว

      @@cppweekly Thank you so much for the response.

  • @platin2148
    @platin2148 5 ปีที่แล้ว +11

    Isn't it that all C++ standards are somewhat of a bug fix because of features the introduced in previous "updates".

    • @frydac
      @frydac 5 ปีที่แล้ว +1

      They also contain them, but C++14 differs in that it didn't bring many completely new features/syntax, like e.g. C++17 did, and now C++20 will bring for sure. Of course it's debatable how to define bug fix vs completely new feature..

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

    You sound tired, hope you're doing well

  • @MdWahidurRahmanOvi
    @MdWahidurRahmanOvi 5 ปีที่แล้ว +1

    Hi, first of all, thank you for your awesome work. I was wondering what compiler you are using

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

      He's using godbolt.org/ , which is not exactly a 'compiler' itself, but more for exploring the language and how compilers optimize.

  • @urizilber7545
    @urizilber7545 2 ปีที่แล้ว

    Great video

  • @esra_erimez
    @esra_erimez 5 ปีที่แล้ว +8

    *Read more*

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

    With 17 out for 2 years and 20 around the corner a video on 14 seems late to the party. It’s like the many articles still calling 11 “new”.

    • @X_Baron
      @X_Baron 5 ปีที่แล้ว +17

      He's doing these videos in the order that the standards were published, to show how the language has developed.