Skip to content

Performance oriented extension methods for enums generated at compile time

License

Notifications You must be signed in to change notification settings

lidgren/lidgren.enumextensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lidgren.enumextensions

Performance oriented extension methods for enums generated at compile time using roslyn source generator.

MyEnum value;

value.ToStringEx();
value.TryParseEx("MemberName");
value.IsDefinedEx();
value.GetNamesEx();
value.GetValuesEx();

Mostly exactly matches the regular enum methods; except that GetNames, GetValues and ToString() does not allocate any memory, but returns a readonly span to preallocated data. Supports any kind of enum, including flags enums.

Benchmarks here

About

Performance oriented extension methods for enums generated at compile time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages