Open Anders429 opened 3 years ago
The array-const-fn-init
crate may be required to make this possible at this point. May need to experiment to see if it can be used with a const generic.
Edit: nevermind, this doesn't work with const generics :(
Looks like this is going to be blocked by the const_fn_fn_ptr_basics
feature becoming stable, since it is needed to allow a function pointer to appear as a const fn parameter.
Rather than having all of the different internal structs have
public
visibility, it may be possible to use anew()
method onWordFilter
to construct it instead. Thenew()
method would need to be aconst fn
to be used instatic
context.The input parameter would just be a fixed-size array of size
N
, with each element being a tuple containing the values needed for aState
, which are:Flags
- This will be an integer value after #67 is completed.c_transitions
- This will be a closure.aliases
- slice of 2-tuples of references.graphemes
- slice of references.The references may be a problem, since they reference into the array being constructed in the
new()
method. This may not have to be a problem though, depending on how self-referencing works in const contexts.