Raised This Month: $14 Target: $400


Post New Thread Reply   
Thread Tools Display Modes
Author Message
AlliedModders Donor
Join Date: May 2017
Location: Crashing Hale
Old 02-07-2021 , 05:35   [EXTENSION] SM-Sets
Reply With Quote #1

So you know how everyone abuses StringMap for O(1) lookup? Well I thought that was silly, so I did something about that by exposing std::unordered_set for plugins to use.

There is CellSet for basic cell types and StringSet for strings.

Very strange caveat, but with CellSets there is a very rare chance for a float, handle, or integer value to be hashed identically to a different value of another type since they could possibly have the same binary value. If you are unfortunate enough to encounter this, then you should go out and purchase a lottery ticket.

Lastly, insertion into sets is based on var-args and you can accidentally send a cell value to a StringSet and vice-versa. Don't do that. That is bad.

Over-engineering is underrated.


Last edited by Scag; 02-07-2021 at 05:35.
Scag is offline

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 19:42.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode