This seems like a really easy thing, but believe it or not my google search hasn’t brought me anywhere. I want to be able to convert a set to a vector. I have tried the following:
sett=Set{Int64}([1,2,3])
vecc=convert(Vector{Int64},sett)
but it appears Julia doesn’t know how to do these conversions.
One obvious thing I can do is using comprehensions e.g.
vecc=[el for el in sett]
but is there not a more elegant way?
Cheers in advance.
>Solution :
Splatting can be problematic from a performance perspective. Instead, use
vecc = collect(sett)