Raised This Month: $32 Target: $400
 8% 

[EXTENSION] SM-Sets


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Scag
AlliedModders Donor
Join Date: May 2017
Location: Crashing Hale
Old 02-07-2021 , 04: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.

REPOSITORY
RELEASES
__________________
Over-engineering is underrated.

GitHub
BTC
ETH

Retired

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



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 16:17.


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