Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

repeat-expressions for arr macro #130

Merged
merged 2 commits into from
Nov 5, 2022
Merged

Conversation

eggyal
Copy link
Contributor

@eggyal eggyal commented Sep 10, 2022

Adds an analogue of the [expr; LENGTH] array initialiser to the arr!
macro, i.e. arr![Type; expr; LENGTH]. Can be used in const contexts.

Note that this implementation builds upon #129, which should be
reviewed/merged before this.

Adds an analogue of the `[expr; LENGTH]` array initialiser to the `arr!`
macro, i.e. `arr![Type; expr; LENGTH]`.  Can be used in const contexts.

Note that this implementation builds upon fizyk20#129, which should be
reviewed/merged before this.
eggyal added a commit to eggyal/generic-array that referenced this pull request Sep 11, 2022
Introduces a trait defining an associated constant of the `Self` type.
The trait is parameterised to distinguish arbitrary constants.  An
implementation is provided for `GenericArray`, providing means of
constructing arbitrary `GenericArray`s in const context.

This plugs a gap that exists even if fizyk20#130 is merged, as generic type
parameters cannot currently be referenced in const context (e.g. if the
repetition length provided to the `arr!` macro comes from a type
parameter).
eggyal added a commit to eggyal/generic-array that referenced this pull request Sep 11, 2022
Introduces a trait defining an associated constant of the `Self` type.
The trait is parameterised to distinguish arbitrary constants.  An
implementation is provided for `GenericArray`, providing means of
constructing arbitrary `GenericArray`s in const context.

This plugs a gap that exists even if fizyk20#130 is merged, as generic type
parameters cannot currently be referenced in const context (e.g. if the
repetition length provided to the `arr!` macro comes from a type
parameter).
eggyal added a commit to eggyal/generic-array that referenced this pull request Sep 11, 2022
Introduces a trait defining an associated constant of the `Self` type.
The trait is parameterised to distinguish arbitrary constants.  An
implementation is provided for `GenericArray`, providing means of
constructing arbitrary `GenericArray`s in const context.

This plugs a gap that exists even if fizyk20#130 is merged, as generic type
parameters cannot currently be referenced in const context (e.g. if the
repetition length provided to the `arr!` macro comes from a type
parameter).
eggyal added a commit to eggyal/generic-array that referenced this pull request Sep 11, 2022
Introduces a trait defining an associated constant of the `Self` type.
An implementation is provided for `GenericArray`, providing means of
constructing default `GenericArray`s in const context.

This plugs a gap that exists even if fizyk20#130 is merged, as generic type
parameters cannot currently be referenced in const context (e.g. if the
repetition length provided to the `arr!` macro comes from a type
parameter).
eggyal added a commit to eggyal/generic-array that referenced this pull request Sep 11, 2022
Introduces a trait defining an associated constant of the `Self` type.
An implementation is provided for `GenericArray`, providing means of
constructing default `GenericArray`s in const context.

This plugs a gap that exists even if fizyk20#130 is merged, as generic type
parameters cannot currently be referenced in const context (e.g. if the
repetition length provided to the `arr!` macro comes from a type
parameter).
eggyal added a commit to eggyal/generic-array that referenced this pull request Sep 11, 2022
Introduces a trait defining an associated constant of the `Self` type.
An implementation is provided for `GenericArray`, providing means of
constructing default `GenericArray`s in const context.

This plugs a gap that exists even if fizyk20#130 is merged, as generic type
parameters cannot currently be referenced in const context (e.g. if the
repetition length provided to the `arr!` macro comes from a type
parameter).
@novacrazy novacrazy merged commit 58f28ed into fizyk20:master Nov 5, 2022
@eggyal eggyal deleted the arr-repeat-expr branch November 5, 2022 21:30
eggyal added a commit to eggyal/generic-array that referenced this pull request Nov 5, 2022
Utilises the `const-default` crate (behind a feature gate) to introduce
a trait defining an associated constant of the `Self` type.  An
implementation is provided for `GenericArray`, providing means of
constructing default `GenericArray`s in const context.

This plugs a gap that exists even after fizyk20#130 was merged, as generic type
parameters cannot currently be referenced in const context (e.g. if the
repetition length provided to the `arr!` macro comes from a type
parameter).
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants