Overengineering max(a, b) Mixed Comparison Functions, Common References & Rust Lifetime Annotations

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

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

  • @emko8037
    @emko8037 วันที่ผ่านมา

    Thanks for the talk
    For the ultimate kick set playback speed to 2x

  • @dadisuperman3472
    @dadisuperman3472 8 วันที่ผ่านมา +1

    Max is an algebraic concept which means the greatest between the two.
    So to say that a negative integer is not comparable to a strictly positive integer is counter intuitive.
    Here you are mixing type theory into the pot, which doesn't always make sense.
    N+ is a subset of N, so the relation '

  • @Roibarkan
    @Roibarkan 6 วันที่ผ่านมา

    53:27 I guess tc_return_tempotary only needs to decay temporary, and is allowed to pass higher lifetimes back out (where the lifetime will get decremented, etc.)

  • @Roibarkan
    @Roibarkan 6 วันที่ผ่านมา +1

    7:27 By the way, Stepanov (author of std::max) later regretted this, and claimed, like Jonathan, that the max of equivalents should have been the second

  • @AlfredoCorrea
    @AlfredoCorrea 7 วันที่ผ่านมา

    10:06 I don't know `std::common_type`, but `std::common_reference` needs to be customized to make several `std::ranges` algorithms to work with user types, specifically when using types that represent references but they are not language references. I guess `std::common_type` can be customized for the similar reasons.