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

Detailed Description

Outline

Purpose

Provide an union test type.

Classes

See also
bsltf_templatetestfacility

Description

This component provides a union type, UnionTestType, that supports the set of operations for a single unconstrained (value-semantic) attribute type. UnionTestType can be used during testing as the parameterized type of a class templates to ensure union types will function correctly. Note that this is particular valuable when testing a container template that supports different types of contained elements.

Attributes

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

Usage

This section illustrates intended use of this component.

Example 1: Constructing And Using The Union

Suppose we wanted to show how objects of UnionTestType can be created and used.

UnionTestType X;
X.setData(-1);
assert(X.data() == -1);
UnionTestType Y = X;
assert(Y == X);
UnionTestType Z(X);
assert(Z == X);