Skip to content

Unify Ones and Zeros as SFill{0} and SFill{k}? #104

Open
@dlfivefifty

Description

@dlfivefifty

It might make the code cleaner to do:

struct SFill{k, T, N, Axes} <: AbstractFill{T,N}
   axes::Axes
end

getindex_value(F::SFill{k,T}) where {k,T} = convert(T,k)

const Ones{T,N,Axes} = SFill{true,T,N,Axes}
const Zeros{T,N,Axes} = SFill{false,T,N,Axes}

It would then be possible to support other special cases. Though whether this machinery is worth it is not clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions