std::weakly_incrementable(3cxx)
π std::weakly_incrementable π
okay bestie, welcome to the std::weakly_incrementable page, straight out of the libstdc++ manual, section 3cxx. it's a whole concept from the C++ standard library and yes it's giving main character energy. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
std::weakly_incrementable β the vibe check for types that can be incremented with ++. like, they just gotta go up. that's it. that's the requirement. π
πΈ SYNOPSIS πΈ
first thing's first, you gotta bring in the header:
#include <iterator>
π Concept definition π
here's the whole thing, verbatim, no edits, no cap:
template<typename _Iter>
concept std::weakly_incrementable = movable<_Iter>
&& requires(_Iter __i)
{
typename iter_difference_t<_Iter>;
requires __detail::__is_signed_integer_like<iter_difference_t<_Iter>>;
{ ++__i } -> same_as<_Iter&>;
__i++;
}
like... look at her. she's literally doing so much in so few lines π₯
π Detailed Description π
Requirements on types that can be incremented with ++.
that's the whole thing bestie. a type has to be movable, it needs an iter_difference_t, that difference type has to be a signed-integer-like type, ++__i has to hand back _Iter& (same type, exactly, no sneaky conversions), and post-increment __i++ has to be a thing too. that's the checklist. slay β¨
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. so like, not a human author, a robot wrote it, and honestly? she ate π
k byeee, this was libstdc++'s std::weakly_incrementable page in section 3cxx β go increment something, you're doing amazing sweetie πππ
π¦ where this page comes from
- ubuntu resolute: libstdc++-13-doc 13.4.0-10ubuntu1
- ubuntu resolute: libstdc++-16-doc 16-20260322-1ubuntu1
- ubuntu stonking: libstdc++-13-doc 13.5.0-1ubuntu1
- ubuntu stonking: libstdc++-16-doc 16.2.0-3ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms