This repository has been archived by the owner on Nov 12, 2023. It is now read-only.
Make sets work in const
contexts
#93
Labels
const
contexts
#93
A lot of the functions in the sets are not
const
because they use closures to destructure internal representations. It should be possible to achieve the destructuring with the use ofconst fn
s though, with no closure, perhaps associatedconst fn
s of the internal representation types.I don't believe it is possible for the builders to work in
const
contexts yet, unless mutable references are allowed inconst
fns (link to tracking issue). I feel like in theory they should be able to work - all of the mutations can occur duringconst
evaluation only, and all of the mutable references go out of scope if thebuild()
function is called. The thing that wouldn't work is aconst
mutable reference at the end ofconst
evaluation (i.e.build()
is not called), which feels like it could be something that an error is generated for only if a mutable reference is left over at the end ofconst
evaluation. That's just my intuitive point of view, though, not sure how it works in practice.The text was updated successfully, but these errors were encountered: