#pragma pass_by_value
Specifies how classes containing const or reference members are passed in function arguments.
The IBM® C++ Compiler V3.6 uses pass by value only if the class has no const or reference data members, and the copy constructor is trivial and the destructor is trivial. VisualAge® C++ V5.0 and later compilers use pass by value if the copy constructor is trivial and the destructor is trivial, regardless of const or reference data members. When -qoldpassbyvalue is in effect, the compiler uses the 3.6 behavior so that when a class containing a const or reference member is passed as a function argument, it is not passed by value. When -qnooldpassbyvalue is in effect, the compiler uses the new behavior so that when a class containing a const or reference member is passed as a function argument, it is passed by value.
The #pragma pass_by_value directive allows you greater control over this option for specific files or sections of source code.
Option syntax .-nooldpassbyvalue-. >>- -q--+-oldpassbyvalue---+-----------------------------------><
>>-| Pragma syntax |------------------------------------------->< Pragma syntax |--#--pragma--pass_by_value--(--+-compat--+--)------------------| +-ansi----+ +-default-+ +-source--+ +-pop-----+ '-reset---'
-qnooldpassbyvalue
Use this option if you are linking to libraries compiled with IBM C++ Compiler V3.6 or earlier. Otherwise, functions that have const or reference class parameter types will give incorrect behavior when they are called from modules compiled with a later version of the compiler. Library headers compiled with IBM C++ Compiler V3.6 or earlier should be protected with the #pragma pass_by_value directive so that users of these libraries will get the correct calling convention for functions in those libraries that use class parameters.
None.