AFAIK, the motive of out parameter is to accept an object(i.e. not constructed yet) and construct it, but what if we pass an already constructed object as out argument, it will get constructed / assigned again and that is inefficient.
for example :
demo of similar problem to understand the construction of object: https://cpp2.godbolt.org/z/zhYo997ad
fun: (out x: int) = x = 5;
main: () -> i32 = {
v1: int = 9;
// v2: int;
fun(out v1); // it should be illegal because it's inefficient (doesn't define the meaning of out parameter)
// fun(out v2); // works fine
}
Expected result : compilation error
Actual result/error : running fine