Typical C++, But Why? - Björn Fahller - CppNorth 2023

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ •

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

    41:33 wouldn’t overloading the close_session function just reintroduce the problem which we are trying to solve by using enum classes?
    Before using enum-> pass the wrong value, underlying type is int-> wrong item gets erased.
    After using enum + overload -> pass the wrong value, overloaded function gets called, wrong item gets erased, unless we have different implementations for each of the overloaded functions

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

    Nice talk.

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

    First solution is a boxing - it's working, for sure, but it have costs, isn't it? Or the compiler can somehow strip away everything except the wrapped string inside the struct?🤔

  • @ultradude5410
    @ultradude5410 Рік тому +1

    Is this a reupload? I swear I've seen the jigsaw puzzles before.

  • @carllee2439
    @carllee2439 Рік тому +1

    Yes, with a lot of hoops and tricks you can start reimplementing features of Rust in your C++ code. Or you can just do the logical step and switch to Rust. What the industy is doing anywhay.

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

    The same argument you use for not using std::span also applies to std::pair, and std::tuple these kind of classes lack semantics and indeed should not be used on API's.