Provide an attribute class to which can not be assigned.
More...
Namespaces |
namespace | bsltf |
Detailed Description
- Outline
-
-
- Purpose:
- Provide an attribute class to which can not be assigned.
-
- Classes:
-
- See also:
- Component 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
-
data
: representation of the class value
-
- 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: