I want to choose Float32, Float64, and BigFloat for computation ( speed and accuracy)
abstract type AbstractVariables{T <: AbstractFloat} end
mutable struct DefaultVariables{T} <: AbstractVariables{T}
x::Vector{T}
end
I like to do it by
mutable struct DefaultVariables{T<: AbstractFloat}
x::Vector{T}
end
Which is better?
When is it necessary to define an abstract type
here?