Skip to content

Commit

Permalink
try an internal constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
juddmehr committed Oct 16, 2024
1 parent 965d77e commit 9f6d11a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/C4Blade/C4Blade.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ struct Section{TFr,TFc,TFt,TAF}
chord::TFc
theta::TFt
af::TAF
Section(r,chord,theta,af) = new(promote(r,chord,theta)..., af)
end

# promote to same type, e.g., duals
function Section(r, chord, theta, af)
r, chord, theta = promote(r, chord, theta)
return Section(r, chord, theta, af)
end
# # promote to same type, e.g., duals
# function Section(r, chord, theta, af)
# r, chord, theta = promote(r, chord, theta)
# return Section(r, chord, theta, af)
# end

# convenience function to access fields within an array of structs
function Base.getproperty(obj::AbstractVector{<:Section}, sym::Symbol)
Expand Down

0 comments on commit 9f6d11a

Please sign in to comment.