Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Parametric type

$
0
0

@ohmsweetohm1 wrote:

Is it possible to write a parametric type with default type?

struct Point{T}
    x::T
    y::T
end

struct Foo
    a::Point{Float64}
    b::Point     # should be the default type: Point{Float64}
    c::Point{Int}
end

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images