What does an exclamation mark mean after the name of a function?

后端 未结 1 1783
既然无缘
既然无缘 2020-12-11 01:03

I saw a function like this

function operator!(c::Matrix, out::Matrix)
    ......
end

What does ! mean here?

相关标签:
1条回答
  • 2020-12-11 01:08

    In Julia, it's a convention to append ! to names of functions that modify their arguments. The reason is Julia function arguments are passed-by-sharing, without this convention, it's not easy to know whether a function will change the content of input arguments or not.

    0 讨论(0)
提交回复
热议问题