Skip to content

Commit

Permalink
Add type parameter to PostOrderDFS
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jan 10, 2020
1 parent bfa7745 commit 91c0542
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/AbstractTrees.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,11 @@ Any[1,Any[2,3]]
we will get [1,2,3,Any[2,3],Any[1,Any[2,3]]]
"""
struct PostOrderDFS <: TreeIterator{Any}
tree::Any
PostOrderDFS(x::Any) = new(x)
struct PostOrderDFS{T} <: TreeIterator{T}
tree::T
end
PostOrderDFS(tree::Tree) = PostOrderDFS(tree.x)
IteratorSize(::Type{PostOrderDFS}) = SizeUnknown()
IteratorSize(::Type{PostOrderDFS{T}}) where T = SizeUnknown()

"""
Iterator to visit the nodes of a tree, guaranteeing that parents
Expand Down

0 comments on commit 91c0542

Please sign in to comment.