IDL_Object::_overloadIsTrue

The IDL_Object::_overloadIsTrue function method defines the behavior of instances of objects that inherit from the IDL_Object class when a “truth test” operation is applied. For example, if an instance of an overloaded object class is used in conjunction with the logical AND (&&) or logical OR (||) operator, IDL calls this method to determine whether the object evaluates as true or false.

This method is designed to replicate the default behavior of objects that do not use operator overloading. As a result, object classes that do inherit from the IDL_Object class but that do not override this particular method will behave in the same manner as object classes that do not inherit from the IDL_Object class.

Tip: If you write an object class that inherits from IDL_Object and overloads this method, you can call the superclass method directly to achieve the default behavior for specific cases.

Syntax

In most cases, this method is called indirectly by another operator such as &&, ||, or the IF statement. When called explicitly, the syntax is:

Result = Obj->[IDL_Object::]_overloadisTrue( )

Return Value

This method is called when the operand being tested for a truth value is an instance of a class that inherits from the IDL_Object class, but that does not implement its own _overloadIsTrue method. The return value replicates the behavior with an object that does not inherit from the IDL_Object class.

Arguments

None

Keywords

None

Routine Signature

To return an explict truth value for an object class, implement a method with the following signature:

FUNCTION class::_overloadIsTrue

The return value of this function should be the truth value for the object being tested.

Version History

8.0

Introduced