gpt4 book ai didi

julia - 等价于 Julia 中的 c\c++ 编译器指令

转载 作者:行者123 更新时间:2023-12-01 10:22:13 24 4
gpt4 key购买 nike

使用像这样的编译器指令

#if A
some instructions
#elseif B
some instructions
#end

在C\C++语言中,可以告诉编译器在某些情况下忽略部分代码。我很想知道 Julia 语言中是否有与此功能等效的功能。

最佳答案

@static正是您要找的。

@static if A
some instructions
elseif B
some instructions
end

关于julia - 等价于 Julia 中的 c\c++ 编译器指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49966769/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com