std::experi...ranges::Same(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::experi...ranges::Same(3) πŸ’–

hii bestie! welcome to the manual page for std::experi...ranges::Same(3), straight outta the C++ Standard Libary (their spelling, not mine πŸ’€). it’s giving β€œtiny concept, big constraint-checking energy” and we’re gonna read it together, okay? 🫢


✨ NAME ✨

std::experimental::ranges::Same β€” std::experimental::ranges::Same. yes bestie, the name is the name, and it’s absolutely serving recursive icon behavior πŸ’….


🌸 Synopsis 🌸

Defined in header <experimental/ranges/concepts>:

template< class T, class U >                                 (ranges
       TS)
concept bool Same = std::is_same<T, U>::value; // see below

The concept Same<T, U> is satisfied if and only if T and U denote the same type. periodt. ✨

Despite being specified using it, there need not be any subsumption relationship between Same<T, U> and std::is_same<T, U>::value. like, do not assume that subsumption link is there, no cap.

For the purposes of constraint checking, Same<T, U> implies Same<U, T>. flip it and reverse it, but only for constraint checking, iykyk πŸ”₯.


πŸ’… Notes πŸ’…

The additional requirement on constraint checking differentiates Same from std::is_same. that’s the whole extra lil’ sparkle ✨.


πŸ¦‹ See also πŸ¦‹

  • is_same β€” checks if two types are the same (C++11) (class template). bestie wanted the class template version, so here it is πŸ’–.

mwah πŸ’‹ this page came from http://cppreference.com, dated 2024.06.10, and it’s the std::experi...ranges::Same(3) manual page. bye bestie, go check those constraints 🫢🌈

πŸ“¦ where this page comes from