Conquering C++20 Ranges - Tristan Brindle - CppCon 2021

Sdílet
Vložit
  • čas přidán 30. 05. 2024
  • cppcon.org/
    github.com/CppCon/CppCon2021
    ---
    This is the final part in a trilogy of talks covering the new Ranges functionality in C++20. Following the format of “C++20 Ranges in Practice” (CppCon 2020), in this installment we’ll look at three more everyday programming problems and discover how Ranges can be used to solve them cleanly, elegantly and concisely. In particular, in this talk we’ll focus on how we can implement our own custom range adaptors, often seen as the “final hurdle” on the road to conquering Ranges. Time permitting, we’ll also take a brief look at the new ranges additions currently in the planning stages for C++23.
    ---
    Tristan Brindle
    ---
    Videos Streamed & Edited by Digital Medium: online.digital-medium.co.uk
    Register Now For CppCon 2022: cppcon.org/registration/
  • Věda a technologie

Komentáře • 19

  • @TheMR-777
    @TheMR-777 Před 2 lety +6

    Oh man it's awesome!
    I was trying to implement the same (fibonacci_view), and was trying to use the “view_interface”, which made me struggle a lot. But failed at the end.
    But now I came to know, (says calmly) “it was so simple!”
    Thank you so much Mr. Brindle for teaching the adapters, to have our own “views”.
    And, Thanks a lot to CppCon as well!

    • @CppCon
      @CppCon  Před 2 lety +1

      Glad it helped!

  • @ferifezino5346
    @ferifezino5346 Před rokem +2

    An amazing Teacher. I need to watch all his talks.

  • @foragerdev
    @foragerdev Před 2 lety +7

    I was waiting for such a good talk on ranges. Really enjoyed.

  • @RichardNatal
    @RichardNatal Před rokem +2

    Just a little correction... it's not std::ranges::unreachable_sentinel_t (or rgn::unreachable_sentinel_t as in the slide) it's std::unreachable_sentinel_t

  • @arthurs4240
    @arthurs4240 Před 2 měsíci

    Great presentation so far! But it looks like we went from 15 lines of 40 lines of code on the exchange example (with the iterator boiler plate). Also the complexity of having to understand cpp20 features + iterators concept.

  • @Bbdu75yg
    @Bbdu75yg Před rokem +3

    Brilliant! 👌 👏 😍 👍!

  • @kanghewill4069
    @kanghewill4069 Před 2 lety +4

    36:19 "What we can't do is call find_if_not and pass std::views::reverse(base_) directly as the first argument..." P2017 should have solved this issue, right?

    • @tcbrindle
      @tcbrindle Před 2 lety +2

      Ah, I’d forgotten about that change! Yes, I believe you’re correct, apologies for the error 🙂

  • @graham12345dd
    @graham12345dd Před rokem

    Time 17.34 in video, couldn't you have used exchange there (you informed us (me!) of it at beginning of video. Would work nicely here, no?

  • @arkadymagomedov1700
    @arkadymagomedov1700 Před rokem

    Failed to implement the last example. The rotate seemingly has no effect... Any chance we could get the sources?

  • @AbamaCai
    @AbamaCai Před 3 měsíci

    Very nice talk, please show your code in git link, We can try play with it.

  • @antoniocs8873
    @antoniocs8873 Před 2 lety

    So is there like a quick recap of all the previous talks from the author? Ranges do seem complicated

    • @TheMR-777
      @TheMR-777 Před 2 lety +1

      Implementation of Adapters do seem complicated, but their usage, feels like absolute POWER!

  • @ayush.kumar.13907
    @ayush.kumar.13907 Před 2 lety +1

    is there going to be something about functional programming with C++ in this CppCon?

  • @VioletGiraffe
    @VioletGiraffe Před rokem +3

    std::exchange is super confusing, it does too many things at once. It smells!

  • @mapron1
    @mapron1 Před 2 lety

    Last example - i think that original version is probably more efficient in terms of speed (but not memory), as we have better memory locality.