The complex and valarray components are parameterized by the type of information they contain and manipulate.
A C++ program shall instantiate these components only with a type
TYPE that satisfies the following requirements:
Tis not an abstract class (it has no pure virtual member functions);
- TYPE is not a reference type;
- TYPE is not cv-qualified;
- If
TYPE is a class, it has a public default constructor;
- If
TYPE is a class, it has a public copy constructor with the signature
TYPE::TYPE(const TYPE&)
- If
TYPE is a class, it has a public destructor;
- If
TYPE is a class, it has a public assignment operator whose signature is either
TYPE& TYPE::operator=(const TYPE&)
or
TYPE& TYPE::operator=(TYPE)
- If
TYPE is a class, the assignment operator, copy and default constructors, and destructor shall correspond to each other as far an initialization of raw storage using the default constructor, followed by assignment, is the equivalent to initialization of raw storage using the copy constructor.
- Destruction of an object, followed by initialization of its raw storage using the copy constructor, is semantically equivalent to assignment to the original object.
- If
TYPE is a class, it shall not overload unary
operator&.
If an operation on
TYPE throws an exception then the effects are undefined.
Specific classes member functions or general functions may have other restrictions.