Описание тега pass-by-value

NonePass-by-value is a "one way passing" so that modifications of the passed value inside the receiving function (or other entity like process, etc) are not returned back.

Pass -by-value is a one way passing so that modifications of the passed value inside the receiving function (or other entity like process, etc) are not returned back.

pass-by-value normally means cloning a variable and making a cloned copy available to the receiving function. Modifications of this copy are allowed, but they are not returned back to the caller; the copy is simply disposed after the call returns.

Passing by value is more secure if the function can also be called by malicious code (malicious code can retain the reference and observe it later even if it cannot modify it). Some are also convinced it results a cleaner code. However passing of the larger structures by value also requires more resources.