C++ Weekly - Ep 401 - C++23's chunk view and stride view

Sdílet
Vložit
  • čas přidán 5. 11. 2023
  • ☟☟ Awesome T-Shirts! Sponsors! Books! ☟☟
    Upcoming Workshop: Understanding Object Lifetime, C++ On Sea, July 2, 2024
    ► cpponsea.uk/2024/sessions/und...
    Upcoming Workshop: C++ Best Practices, NDC TechTown, Sept 9-10, 2024
    ► ndctechtown.com/workshops/c-b...
    Check out Undo's Time Travel Debugging! undo.io/cppweekly
    Episode Details: github.com/lefticus/cpp_weekl...
    T-SHIRTS AVAILABLE!
    ► The best C++ T-Shirts anywhere! my-store-d16a2f.creator-sprin...
    WANT MORE JASON?
    ► My Training Classes: emptycrate.com/training.html
    ► Follow me on twitter: / lefticus
    SUPPORT THE CHANNEL
    ► Patreon: / lefticus
    ► Github Sponsors: github.com/sponsors/lefticus
    ► Paypal Donation: www.paypal.com/donate/?hosted...
    GET INVOLVED
    ► Video Idea List: github.com/lefticus/cpp_weekl...
    JASON'S BOOKS
    ► C++23 Best Practices
    Leanpub Ebook: leanpub.com/cpp23_best_practi...
    ► C++ Best Practices
    Amazon Paperback: amzn.to/3wpAU3Z
    Leanpub Ebook: leanpub.com/cppbestpractices
    JASON'S PUZZLE BOOKS
    ► Object Lifetime Puzzlers Book 1
    Amazon Paperback: amzn.to/3g6Ervj
    Leanpub Ebook: leanpub.com/objectlifetimepuz...
    ► Object Lifetime Puzzlers Book 2
    Amazon Paperback: amzn.to/3whdUDU
    Leanpub Ebook: leanpub.com/objectlifetimepuz...
    ► Object Lifetime Puzzlers Book 3
    Leanpub Ebook: leanpub.com/objectlifetimepuz...
    ► Copy and Reference Puzzlers Book 1
    Amazon Paperback: amzn.to/3g7ZVb9
    Leanpub Ebook: leanpub.com/copyandreferencep...
    ► Copy and Reference Puzzlers Book 2
    Amazon Paperback: amzn.to/3X1LOIx
    Leanpub Ebook: leanpub.com/copyandreferencep...
    ► Copy and Reference Puzzlers Book 3
    Leanpub Ebook: leanpub.com/copyandreferencep...
    ► OpCode Puzzlers Book 1
    Amazon Paperback: amzn.to/3KCNJg6
    Leanpub Ebook: leanpub.com/opcodepuzzlers_book1
    RECOMMENDED BOOKS
    ► Bjarne Stroustrup's A Tour of C++ (now with C++20/23!): amzn.to/3X4Wypr
    AWESOME PROJECTS
    ► The C++ Starter Project - Gets you started with Best Practices Quickly - github.com/cpp-best-practices...
    ► C++ Best Practices Forkable Coding Standards - github.com/cpp-best-practices...
    O'Reilly VIDEOS
    ► Inheritance and Polymorphism in C++ - www.oreilly.com/library/view/...
    ► Learning C++ Best Practices - www.oreilly.com/library/view/...
  • Věda a technologie

Komentáře • 19

  • @SergeyIvanov1337
    @SergeyIvanov1337 Před 7 měsíci +1

    I love these in rust and am glad to see them being incorporated into c++

  • @vanandgasparyan1430
    @vanandgasparyan1430 Před 7 měsíci +3

    I think the difference between chunk_by and split is the latter filters out the delimiter.

  • @abhinavk0929
    @abhinavk0929 Před 7 měsíci +7

    C++ should have langauge feature similar to iota (because it is far too long to type) but the reason I think it should be a language feature is to somehow cover the use cases of index_sequence and integer_sequence too (that'd also reduce the need for their 'make' counterparts). Just think about it, a simple terse syntax to get a range of integers whether you need it at runtime or compile-time. How does that sound?

  • @anon_y_mousse
    @anon_y_mousse Před 7 měsíci

    Hrm. I'm still on g++ 11.2, so it's not going to work for me. I'm leery of manually updating the compiler because of past issues, so until my distro updates this will be yet another feature I can't make use of in conventional ways. It also illustrates a problem with languages taking so long to finally add features that should've existed since the beginning.

    • @ohwow2074
      @ohwow2074 Před 7 měsíci

      Change your distro. It's as simple as that. Slow moving distros slow us down.

    • @anon_y_mousse
      @anon_y_mousse Před 7 měsíci

      @@ohwow2074 Nah, I'll just not make use of a barely useful feature that should've always existed anyway, or I'll find a Boost equivalent.

    • @ohwow2074
      @ohwow2074 Před 7 měsíci

      @@anon_y_mousse it's not just about ranges. You're missing out on a lot of new features.

    • @anon_y_mousse
      @anon_y_mousse Před 7 měsíci

      @@ohwow2074 Have any examples of something I can't easily do myself?

    • @ohwow2074
      @ohwow2074 Před 7 měsíci

      @@anon_y_mousse span? Coroutines and concepts? Deducing this? Spaceship operator?

  • @ifgpuelse
    @ifgpuelse Před 7 měsíci

    Have you guys already take a loop at ranges-v3 library?

  • @jhbonarius
    @jhbonarius Před 7 měsíci

    Short isn't a problem
    At least, that what's she said.
    Badaboom

  • @Sebanisu
    @Sebanisu Před 7 měsíci +1

    hmm the title says stride_view but I don't think you talked about it in the video.

    • @abhinavk0929
      @abhinavk0929 Před 7 měsíci

      he did talk about it towards the end

    • @TheMR-777
      @TheMR-777 Před 7 měsíci

      The std::views::chunk and std::views::stride are actually the objects of std::ranges::chunk_view and std::ranges::stride_view. So, effectively, they're the same.
      (you can give it a try mate)

    • @Sebanisu
      @Sebanisu Před 7 měsíci

      ​@@abhinavk0929I must have not noticed it. In my mind I heard him talk about chunk_by then the end of the video. After rewatching the end I see I was wrong heh.

    • @benjaminshinar9509
      @benjaminshinar9509 Před 6 měsíci

      If i get this correctly then stride is 'chunk and take the first element'?

    • @TheMR-777
      @TheMR-777 Před 6 měsíci

      @@benjaminshinar9509 Yeah you can say. But in my mind, stride(n) is something like:
      for (int i = 0; i < x; i += n) { /*you get the point*/ }