BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsltf_nonassignabletesttype

Detailed Description

Outline

Purpose

Provide an attribute class to which can not be assigned.

Classes

See also
bsltf_templatetestfacility

Description

This component provides a single, unconstrained (value-semantic) attribute class, NonAssignableTestType, that does not not support assignment. This is particularly valuable when testing container operations that works with non-assignable types.

Attributes

Name Type Default
------------------ ----------- -------
data int 0

Usage

This section illustrates intended use of this component.

Example 1: Demonstrating The Type Cannot Be Assigned To

Suppose we wanted to show NonAssignableTestType can't be assigned to:

First, we create two NonAssignableTestType objects, X and Y:

NonAssignableTestType X(1);
NonAssignableTestType Y(2);

Now, we show that assigning X from Y will not compile:

X = Y; // This will not compile