How to define generic type limit to primitive types?

You can use this to limit it to value types:

where C: struct

You also mention string. Unfortunately, strings won’t be allowed as they are not value types.

Leave a Comment