std::flat_multiset::size(3)

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

Hey bestie πŸ’– this is the std::flat_multiset::size(3) page from the C++ Standard Libary manual. It’s short, it’s cute, it’s giving β€œone method, no drama” energy ✨

πŸ’– NAME πŸ’–

std::flat_multiset::size β€” literally std::flat_multiset::size, that’s the name, that’s the vibe, we move πŸ’…

🌸 Synopsis 🌸

size_type size() const noexcept;

(since C++23) ✨

Returns the number of elements in the container adaptor. Equivalent to return c.size();.

πŸŽ€ Parameters πŸŽ€

(none) β€” not a single parameter, she takes no arguments πŸ™ˆ

πŸ¦‹ Return value πŸ¦‹

The number of elements in the container adaptor. Periodt πŸ’–

⭐ Complexity ⭐

Constant. No scrolling, no stress, just constant vibes πŸ”₯

🌈 Example 🌈

The following code uses size to display the number of elements in a std::flat_multiset<int>:

// Run this code

#include <iostream>
#include <flat_set>

int main()
{
    std::flat_multiset<int> nums{1, 3, 5, 7};

    std::cout << "nums contains " << nums.size() << " elements.\n";
}

Output:

nums contains 4 elements.

πŸ‘‘ See also πŸ‘‘

  • empty β€” checks whether the container adaptor is empty (public member function)
  • size β€” listed as just size in the original, with no description attached 🫢
  • ssize β€” returns the size of a container or array (C++17) (function template) (C++20)
  • max_size β€” returns the maximum possible number of elements (public member function)

That’s the whole page, bestie πŸ’– source/version/date: http://cppreference.com, 2024.06.10, std::flat_multiset::size(3). Byeee πŸŽ€

πŸ“¦ where this page comes from