Skip to content

Commit

Permalink
new inner constructor syntax ala JuliaLang#20308
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Feb 11, 2017
1 parent b282c29 commit 466dc70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/dimensionful.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# represents a quantity in furlongs^p
struct Furlong{p,T<:Number} <: Number
val::T
Furlong(v::Number) = new(v)
Furlong(x::Furlong{p}) = new(x.val)
Furlong{p,T}(v::Number) where {p,T} = new(v)
Furlong{p,T}(x::Furlong{p}) where {p,T} = new(x.val)
end
Furlong{T<:Number}(x::T) = Furlong{1,T}(x)
(::Type{T}){p,T}(x::Furlong{p,T}) = x.val
Expand Down

0 comments on commit 466dc70

Please sign in to comment.