C++ Insights - Episode 30: C++17's constexpr if

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

КОМЕНТАРІ • 4

  • @adeelahmad9875
    @adeelahmad9875 4 місяці тому +1

    Nice !!

  • @sebastienlevy8127
    @sebastienlevy8127 2 роки тому +4

    Like it, thanks, one question however related to the PT type alias, why do you use std::remove_reference_t alongside with remove_reference_t? If I'm correct, remove_cvref_t removes both const, volatile AND reference qualifiers. Isn't that redundant?

    • @TheMR-777
      @TheMR-777 2 роки тому

      I was wondering about it as well.

    • @andreas_fertig
      @andreas_fertig  2 роки тому +3

      Yes, it is redundant! Thanks for pointing that out. My original example was C++17 code, where we don't have remove_cvref_t. I decided to update the example for the recording to use C++20 and overlooked the redundancy. Nonetheless, I would use the alias PT to shorten the longish std::remove_cvref_t in the following code.
      Andreas