C++ Weekly - Ep 176 - Important Parts of C++11 in 12 Minutes

Поділитися
Вставка
  • Опубліковано 11 січ 2025

КОМЕНТАРІ • 39

  • @TonyAntonucci
    @TonyAntonucci 4 роки тому +14

    CORRECTION: In #3, lambdas. The function should call. std::count_if. As std::count takes a value as the third parameter, not a predicate.

    • @GeorgeTsiros
      @GeorgeTsiros Рік тому

      that is silly. They should have kept std::count for use with the lambda. "count_if" doesn't make _sense_ . What, do I count only if the predicate returns true, otherwise I do not count? Oh well... you can always write your own ::count(iterable, predicate) ...

  • @DanielsThierry
    @DanielsThierry 5 років тому +1

    Thank you for your hard work on giving us, laymen, an opportunity to learn C++
    Your videos are an excellent companion to any course on c++.

  • @emiliancioca
    @emiliancioca 5 років тому +5

    Awesome recap :) The groundwork paved by move semantics really can't be understated.
    As far as auto goes, it's hard to argue against using it for iterator functions (begin/end) and casts where the type already appears on the same line. Of course every project will be different.

    • @obinator9065
      @obinator9065 5 років тому +3

      Or when your type would be too verbose.

  • @magabelab
    @magabelab 2 роки тому

    Just integrated your chai script engine in my 2 qt applications, wow great job men, I couldn't be more happier

  • @marksilverman
    @marksilverman 5 років тому +17

    Five times thirteen is fifteen? Is that one of those floating point errors?

  • @slavamelanko5992
    @slavamelanko5992 5 років тому +3

    Like such overview over standards. Thank you!

  • @jorickcaberio1865
    @jorickcaberio1865 5 років тому +13

    your new mic sounds good!

  • @LaszloAshin
    @LaszloAshin 5 років тому +45

    But Jason, where is move semantics?! 🤔

    • @piotrarturklos
      @piotrarturklos 5 років тому +2

      Yeah. Move semantics is a big feature because it enables people to almost always return results from functions via the return type rather than through ref arguments. The problem I see is that it does not fit this video because it would need another hour of explanations 😁

    • @theRECONN
      @theRECONN 5 років тому +2

      piotrarturklos what? how? Move semantics don't change anything about the return type. Tuples allow multiple results, lvalue references allow returning a passed parameter. Copy elision makes it costless to return by copy. What do you mean by that? Where do move semantics help out with return types?

  • @GregoryTheGr8ster
    @GregoryTheGr8ster 5 років тому

    Excellent summary of the important additions to '11, dude!

  • @ultimatesoup
    @ultimatesoup Рік тому

    I think you should almost ALWAYS use auto where it's applicable. It's impossible to change types in code otherwise

  • @shameelgoldentrio2928
    @shameelgoldentrio2928 3 роки тому +1

    What does the narrator mean by "slicing" at 5:08?

  • @TheMR-777
    @TheMR-777 3 роки тому +1

    Memetic Title: Important Parts of C++11 in a Nutshell

  • @DamianReloaded
    @DamianReloaded 5 років тому +12

    Those features effectively transformed c++ into ++c.

    • @jewulo
      @jewulo 5 років тому +2

      That is so good. Truly a linguistic hack.

  • @cmdlp4178
    @cmdlp4178 5 років тому +4

    These are the most important features of C++, which make C++ distinct from all other programming languages. C++11 was the most significant update of the language. C++14 and C++17 are just the final completion of C++11. I guess the only notable things are structured bindings and initializations in if/switch statements in C++17.
    But C++20 is likely to be as a big improvement as C++11: concepts, designated initializers(~named parameters in initializers, is already a thing in C), spaceship operator , string literals as template parameters(definitely useful), ranges, consteval, coroutines and modules. I wonder how much is going to be in the final C++20. I also wondered about constexpr virtual functions, it does not make sense for me. But why not template virtual functions, I think they are only implementable with runtime compilation/JIT compiler.

    • @akj7
      @akj7 5 років тому

      cmdLP , for C++20 i was hoping they made asio part of the standard or at least added a way to handle server-side programming a bit easier. Some sort of standard GUI would be nice (They could copy from gtkmm), like tkinker for Python.

    • @cmdlp4178
      @cmdlp4178 5 років тому

      @@akj7 Even the iostreams need to be redone. I guess that this needs to be done first. All implementations of iostreams use inheritance with virtual functions. It was meant that istream and ostream are interfaces, which are subclassed by {io}fstream, {io}stringstream and whatever the class of std::cin, std::cout,... is. But it is not easy to implement an own stream class. It is not possible to use a file, created by some POSIX function within iostreams. I guess subclassing iostream is even undefined behavior.

  • @Minty_Meeo
    @Minty_Meeo Рік тому

    I feel like move semantics deserves more than a passing mention when reviewing C++11.

    • @cppweekly
      @cppweekly  Рік тому

      Really well written modern C++ very rarely needs to know about move semantics and instead reduces temporaries and takes advantage of return value optimizations.

  • @2002budokan
    @2002budokan 2 роки тому

    Please use dark theme in your editor, my eyes are burning especially in late nights. Any how thank you for your videos.

  • @SuperBorisl
    @SuperBorisl 5 років тому

    I suppose count_if with lambda..

  • @valizeth4073
    @valizeth4073 5 років тому +1

    Why do u call new instead of make_unique?

  • @chrischoir3594
    @chrischoir3594 5 років тому

    Lambda is Greek for "Lazy"

  • @curtispenner2
    @curtispenner2 5 років тому

    The microphone is not good. Sounds like you are talking through a comb (yes a comb).

  • @danielphd5072
    @danielphd5072 5 років тому +1

    Thank you #cpp #cplusplus

  • @chrischoir3594
    @chrischoir3594 5 років тому +2

    auto is dangerous IMO, it makes C++ more like python or some girly-man language

    • @chrischoir3594
      @chrischoir3594 4 роки тому

      @Lorem Ipsum lol yeah but I am still right. auto is for jokers

    • @steveneumeyer681
      @steveneumeyer681 3 роки тому

      dude i lol'd. unfortunately for me i'm getting paid to use some girly man tech right now

    • @chrischoir3594
      @chrischoir3594 3 роки тому

      @@steveneumeyer681 yeah and you are getting paid BIG but no one is making use auto. You don't need to use it

    • @cavalfou
      @cavalfou 3 роки тому

      ever tried groovy ?