std::bitset::size(3)
β¨ NAME β¨
okay so bestie, this is std::bitset::size(3) β the NAME section literally says std::bitset::size, and honestly itβs just std::bitset::size, a self-love moment π
. it comes from the C++ Standard Libary manual (thatβs the manual name, folded in right here instead of copying the header line, periodt).
πΈ Synopsis πΈ
the signature is right here with since-C++11 glow-up energy:
std::size_t size() const; (noexcept since C++11)
(constexpr since C++11)
Returns the number of bits that the bitset holds. thatβs it, thatβs the whole function β¨.
π Parameters π
(none) β she takes no parameters, not a single one, literally none π.
π Return value π
the number of bits that the bitset holds, i.e. the template parameter N. no cap, thatβs the return value.
π¦ Example π¦
hereβs the code, bestie β run it and watch it eat:
// Run this code
#include <bitset>
#include <iostream>
int main()
{
std::cout << std::bitset<0x400>().size() << '\n';
}
Output:
1024
π See also π
countβ returns the number of bits set totrue(public member function). iconic adjacent behavior, ngl.
xoxo, source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::bitset::size(3) β bye bestie, go slay your bits ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms