Skip to content

Conversation

@elcritch
Copy link

@elcritch elcritch commented May 3, 2025

Makes a new base type StackStringBase[T; Size: static Natural] that has a generic parameter for the string length size.

For backwards compatibility purposes, StackString[N: static Natural] is defined as a type alias type StackString*[Size: static Natural] = StackStringBase[Natural, Size].

There is a compile time check in the constructor functions (like stackStringOfCap) that gives a compile time error if T is not large enough to hold Size characters. Unfortunately I couldn't find a way get the compiler to do the check in the type itself.

@termermc
Copy link
Owner

termermc commented May 9, 2025

I've been pretty busy recently, I'll review and test this out when I wake up tomorrow. Sorry for the delay, and thank you for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants