std::__detail::_Mod_range_hashing(3cxx)

🌸 std::__detail::_Mod_range_hashing β€” a 3cxx girlypop moment 🌸

okay bestie, welcome to the libstdc++ section 3cxx manual, and today's main character is std::__detail::_Mod_range_hashing πŸ’…


✨ NAME ✨

std::__detail::_Mod_range_hashing β€” the default range hashing function, bestie. it literally just uses division to fold a big ol' number down into the range [0, N). that's it. that's the whole job. and it ate. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <hashtable_policy.h>

πŸ’œ Public Types

  • typedef std::size_t first_argument_type β€” the type of the first thing you hand it, and yes it's a std::size_t, no surprises here 🫢
  • typedef std::size_t result_type β€” what comes back out. also std::size_t. consistent queen. πŸ‘‘
  • typedef std::size_t second_argument_type β€” the second thing you hand it. you guessed it: std::size_t. 🌈

πŸ’– Public Member Functions

  • result_type operator() (first_argument_type __num, second_argument_type __den) const noexcept β€” the moment we've all been waiting for. it takes __num and __den, and it's const noexcept, so no drama, no exceptions, just vibes. ✨

🧚 Detailed Description 🧚

Default range hashing function: use division to fold a large number into the range [0, N).

no cap, that's the whole personality. it takes a big number, does a division situation, and drops it neatly inside [0, N). iconic behavior honestly. πŸ”₯


πŸ’€ Author πŸ’€

Generated automatically by Doxygen for libstdc++ from the source code.

(not me getting my whole identity auto-generated by Doxygen 😭 she's a bot but she's serving fr fr)


lowkey important: _Mod_range_hashing is in the __detail namespace, which means it's an implementation detail of libstdc++ β€” iykyk, you probably shouldn't be out here calling it by name in your own code. πŸ™ˆ

and that's the tea, bestie β€” this page lives in the libstdc++ docs, 3cxx section, footer reading libststd::__detail::_Mod_range_hashing(3cxx), and there's no date on it so I'm not inventing one, periodt. stay hydrated, go touch grass, and may your hashes always land in range. πŸ’–βœ¨πŸ¦‹πŸŒΈπŸŽ€

πŸ“¦ where this page comes from