Add const_fn!{} macro to make functions const without duplication. #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Many functions that can be const live in a generic context with bounds,
where
const fn
is not allowed without the "const_fn" feature.In many places, functions duplicated becaue of this: A version with and
version without
const
.This macro cleans that up by making it easy to define a function as
const only if possible, removing all duplication.
Also makes some more functions
const
.