Title
contract_violation's special member functions
Status
new
Section
[support.contract.cviol]
Submitter
Tim Song

Created on 2018-07-10.00:00:00, last changed 2018-07-10.00:00:00.

Messages

Date: 2018-07-10.00:00:00

contract_violation is currently defined as:

class contract_violation {
public:
  uint_least32_t line_number() const noexcept;
  string_view file_name() const noexcept;
  string_view function_name() const noexcept;
  string_view comment() const noexcept;
  string_view assertion_level() const noexcept;
};

which implies a full set of defaulted special member functions with entirely unclear semantics, and can arguably be read to imply that it is an aggregate.

It seems unlikely that we meant for users to default construct or copy contract_violation objects, but if we did want to do that, we need to at least specify the behavior of a default constructed contract_violation object and how copying and moving work with respect to the lifetime of the strings referenced by the string_views returned by its member functions.

History
Date User Action Args
2018-07-10 00:00:00admincreate