std::experi...gnedIntegral(3)

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

πŸ’– std::experimental::ranges::SignedIntegral πŸ’–

okay bestie, this is the std::experi...gnedIntegral(3) page from the C++ Standard Library manual, and we are about to get into a concept that is lowkey iconic ✨


🌸 NAME 🌸

std::experimental::ranges::SignedIntegral β€” yes, that’s the whole name, and yeah, it’s repeated: std::experimental::ranges::SignedIntegral. she said it twice so you know she’s serious πŸ’…

🫢 Synopsis 🫢

Defined in header <experimental/ranges/concepts>

template< class T >
(ranges TS)
concept bool SignedIntegral = Integral<T> &&
std::is_signed<T>::value;

The concept SignedIntegral<T> is satisfied if and only if T is an integral type and std::is_signed<T>::value is true. periodt πŸ’–

There need not be any subsumption relationship between SignedIntegral<T> and std::is_signed<T>::value. that’s the rule, no cap.

πŸ¦‹ Notes πŸ¦‹

SignedIntegral<T> may be satisfied by a type that is not a signed integer type β€” for example, char on a system where char is signed. so yes, the vibe check can pass even when the type name is giving β€œnot exactly what you expected” πŸ™ˆ

πŸŽ€ See also πŸŽ€

  • is_integral β€” checks if a type is an integral type (C++11) (class template)
  • is_signed β€” checks if a type is a signed arithmetic type (C++11) (class template)

mwah πŸ’‹ take care bestie, and remember: concepts are just fancy vibes with rules πŸ’œ β€” this cutie came from cppreference.com, version/date 2024.06.10.

πŸ“¦ where this page comes from