opt_classresults

Controls the omission of the copy constructor call for class return types if all return statements in a function return the same local class object.

Syntax
  #pragma opt_classresults on | off | reset
  
  
Remarks

The following listing shows an example.

Listing: Example #pragma opt_classresults

#pragma opt_classresults on

struct X {

  X();

  X(const X&);

  // ...

};

X f() {

  X x; // Object x will be constructed in function result buffer.

  // ...

  return x; // Copy constructor is not called.

}

This pragma does not correspond to any panel setting. By default, this pragma is on.