Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bsltf_nontypicaloverloadstesttype
[Package bsltf]

Provide a class that overloads the non-typical operators. More...

Namespaces

namespace  bsltf

Detailed Description

Outline
Purpose:
Provide a class that overloads the non-typical operators.
Classes:
bsltf::NonTypicalOverloadsTestType test class that non-typical operators
Description:
This component provides a single, unconstrained (value-semantic) attribute class, NonTypicalOverloadsTestType, that defines overloads to some non-typically-overloaded operators ('operator new', operator delete, and operator&) to ensure that they do not get invoked.
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 Calling Operator New/Delete Induce Assertions:
Suppose that we wanted to show that calling operator new and operator delete on 'NonTypicalOverloadsTestType causes an assertion.
First, we verify that calling operator new will result in an assertion:
  bsls::AssertTestHandlerGuard guard;
  BSLS_ASSERTTEST_ASSERT_OPT_FAIL(new NonTypicalOverloadsTestType());
Finally, we verify that calling operator delete will result in an assertion:
  NonTypicalOverloadsTestType obj;
  BSLS_ASSERTTEST_ASSERT_OPT_FAIL(delete obj);