Skip to content
This repository was archived by the owner on Nov 12, 2023. It is now read-only.
This repository was archived by the owner on Nov 12, 2023. It is now read-only.

Make sets work in const contexts #93

@Antikyth

Description

@Antikyth

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 of const fns though, with no closure, perhaps associated const fns 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 in const fns (link to tracking issue). I feel like in theory they should be able to work - all of the mutations can occur during const evaluation only, and all of the mutable references go out of scope if the build() function is called. The thing that wouldn't work is a const mutable reference at the end of const 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 of const evaluation. That's just my intuitive point of view, though, not sure how it works in practice.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttaskAn essential task for a planned milestone.

Type

No type

Projects

Status

Assigned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions