Mercurial > repos > public > sbplib_julia
diff src/Grids/grid.jl @ 1510:606975cdb1f3 refactor/component_type
Allow component_type to accept more types of inputs
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 21 Mar 2024 07:59:03 +0100 |
parents | a863aef1f799 |
children | 7476877c0b0e |
line wrap: on
line diff
--- a/src/Grids/grid.jl Tue Jan 23 20:39:06 2024 +0100 +++ b/src/Grids/grid.jl Thu Mar 21 07:59:03 2024 +0100 @@ -37,8 +37,8 @@ The type of the components of the coordinate vector of `Grid` `g`. """ -component_type(::Type{<:Grid{T}}) where T = eltype(T) -component_type(g::Grid) = component_type(typeof(g)) +component_type(T::Type) = eltype(eltype(T)) +component_type(t) = component_type(typeof(t)) """ refine(g::Grid, r)