I have a reference object without a copy factory. I get a compiler error when passing an instance of that object to a function that takes a const &in reference when the object is a global variable but not when it is a local variable. Is this a bug or a feature?
MyObject x;
void main()
{
myFunc(x); // Compile error: There is no copy operator for the type 'MyObject' available.
}
void myFunc(const MyObject &in y)
{
// Do something
}
void main()
{
MyObject x;
myFunc(x); // Compiles successfully
}
void myFunc(const MyObject &in y)
{
// Do something
}