Share via


TBoundProperty.operator>(TBoundProperty&) (Compact 7)

3/12/2014

The > overloaded operator determines whether the value encapsulated in a TBoundProperty<PropertyType> object is greater than a value in another TBoundProperty<PropertyType> object in a C++ expression.

Syntax

bool operator>(
TBoundProperty & value)

Parameters

Return Value

Returns true if the operand on the left is greater than the operand on the right. Otherwise, returns false.

Remarks

For more information about using relational operators, see C++ Relational and Equality Operators.

The following example code uses the > operator with two operands of type TBoundProperty<PropertyType>.

For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.

#include "XamlRuntime.h"
#include "XRPropertyBag.h"

#define CHK_BOOL(x) { \
    if (!(x)) { \
        ASSERT(!"Assertion failed"); \
        return E_FAIL; \
    }}

void Check_relational_operator()
{
     XRValue value1;
     XRValue value2;

     value1.SetValue(1);
     value2.SetValue(2);

     TBoundProperty<int> propInt1;
     TBoundProperty<int> propInt2;
    
     propInt1.Set(&value1);
     propInt2.Set(&value2);

    CHK_BOOL((propInt2 > propInt1));
}

Requirements

Header

XRPropertyBag.h

See Also

Reference

C++ Overloaded Operators for TBoundProperty<PropertyType>
TBoundProperty.bool operator>=(TBoundProperty&)
TBoundProperty<PropertyType>