小编Yas*_*ava的帖子

在朱莉娅的可变结构的构造函数中的字典

是否可以用变量dict初始化一个可变结构.我正在尝试以下方法:

mutable struct Global
    speciesCnt::Int64
    chromosomeCnt::Int64
    nodeCnt::Int64
    innov_number::Int64
    innovations::Dict{(Int64,Int64),Int64}
    cf::Config
    function Global(cf::Config)
        new(0,0,0,0,Dict{(Int64,Int64),Int64}(),cf) # global dictionary
    end
end
Run Code Online (Sandbox Code Playgroud)

但是,当我运行它时,我收到以下错误:

LoadError:TypeError:in Type,in parameter,expected Type,得到Tuple {DataType,DataType}.

任何帮助是极大的赞赏.我正在使用Julia v 1.0

julia

3
推荐指数
1
解决办法
237
查看次数

标签 统计

julia ×1