CppCon 2016: Walter E. Brown “What C++ Programmers Need to Know about Header <random>"

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

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

  • @optimusvladx
    @optimusvladx 7 ปีที่แล้ว +15

    I really appreciate that Walter Brown takes his craft seriously. He seems like a pleasantly professional guy.

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

    That's a really nice tie

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

    22:52 a clock, watching this because I don't need sleep, i need answers.

  • @MarekKnapek
    @MarekKnapek 8 ปีที่แล้ว +9

    Almost everyone initializes their engine by a single integer from random generator. Mersenne twister has huge state and almost everybody initializes it with single integer, that gives you only 232 different sequences. Correct usage is to gather enough "true" random bits into vector or array and pass this data through seed_seq like interface into mersenne twister constructor.

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

      Perhaps he meant 1 char?

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

    The random-iterator-stuff is especially interesting!

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

    CppCon video without subtitles?
    Wow
    Truly random

  • @germandiagogomez
    @germandiagogomez 8 ปีที่แล้ว +3

    Walter Brown has great presentation skills. Among my favorites. There are many good presenters, but I think that him and Andrei Alexandrescu stand apart for different reasons. They are really good at exposing. Walter Brown's metaprogramming Compendium is impressively well explained too.

  • @vonkruel
    @vonkruel 8 ปีที่แล้ว +2

    I'm guilty of "rolling my own" and getting it wrong - with RNG as well as other things. When nobody is relying on your bad code for anything important, it's OK ; you learn from your mistakes and move on. It's pretty nice to do less work and get a much better result.
    For RNG I've been using Melissa O'Neil's "randutils" header, which builds on the excellent interfaces & facilities provided in to give an interface that's more convenient for most uses. One highlight is good seeding by default using a variety of local sources of entropy. std::random_device seems like it can help with seeding but it can't be relied on for that (not portably at least). I've heard that Melissa's work (or something much like it) may make it into the language spec.

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

      Dr. Brown mentioned Professor O'Neil's work in his talk, and that her PCG random generator might make it into STL (not into the core language specification). She also co-authored a proposal titled "Simplifying simple uses of " (www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0347r0.html)

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

      Doesn't the C++ language spec include a specification of what's in the STL? I thought it was one big fat document.

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

      Yes, it is indeed one big fat document, e.g. the working draft for C++17 here: open-std.org/JTC1/SC22/WG21/docs/papers/2016/n4606.pdf
      In general, it seems to be common to distinct between "Core Language Specification" and "Library Specification" (sections 17-30 in said document). I figured you'd refer to the former.

  • @DefWorlds
    @DefWorlds 8 ปีที่แล้ว

    It would be interesting to see how the interfaces of random could be adapted to make proper use of quasi random sampling (low discrepancy sequences). I'll like an interface where I could use either.

  • @pablo_brianese
    @pablo_brianese 4 ปีที่แล้ว

    This is perfect. Exactly what I was searching for.

  • @rubykorubyko3172
    @rubykorubyko3172 7 ปีที่แล้ว

    very clever man. One from not so many talks which I enjoyed.

  • @victornoagbodji
    @victornoagbodji 8 ปีที่แล้ว

    excellent talk.

  • @pablo_brianese
    @pablo_brianese 4 ปีที่แล้ว

    At 1:00:00. Lambda functions need ;'s and [] replaced by [=]