Quantum++
v1.0-rc2
A modern C++11 quantum computing library
|
Base class for generating Quantum++ custom exceptions. More...
#include <classes/exception.h>
Public Member Functions | |
Exception (const std::string &where) | |
Constructs an exception. More... | |
virtual const char * | what () const noexcept override |
Overrides std::exception::what() More... | |
virtual std::string | type_description () const =0 |
Exception type description. More... | |
Private Attributes | |
std::string | where_ |
Base class for generating Quantum++ custom exceptions.
Derive from this class if more exceptions are needed, making sure to override qpp::exception::Exception::type_description() in the derived class and to inherit the constructor qpp::exception::Exception::Exception(). Preferably keep your newly defined exception classes in the namespace qpp::exception.
Example:
|
inline |
Constructs an exception.
where | Text representing where the exception occurred |
|
inlinepure virtual |
Exception type description.
Implemented in qpp::exception::CustomException, qpp::exception::UndefinedType, qpp::exception::SizeMismatch, qpp::exception::TypeMismatch, qpp::exception::OutOfRange, qpp::exception::NoCodeword, qpp::exception::NotBipartite, qpp::exception::NotQubitSubsys, qpp::exception::NotQubitVector, qpp::exception::NotQubitRvector, qpp::exception::NotQubitCvector, qpp::exception::NotQubitMatrix, qpp::exception::PermMismatchDims, qpp::exception::PermInvalid, qpp::exception::SubsysMismatchDims, qpp::exception::DimsMismatchVector, qpp::exception::DimsMismatchRvector, qpp::exception::DimsMismatchCvector, qpp::exception::DimsMismatchMatrix, qpp::exception::DimsNotEqual, qpp::exception::DimsInvalid, qpp::exception::MatrixMismatchSubsys, qpp::exception::MatrixNotSquareNorVector, qpp::exception::MatrixNotSquareNorRvector, qpp::exception::MatrixNotSquareNorCvector, qpp::exception::MatrixNotVector, qpp::exception::MatrixNotRvector, qpp::exception::MatrixNotCvector, qpp::exception::MatrixNotSquare, qpp::exception::ZeroSize, and qpp::exception::Unknown.
|
inlineoverridevirtualnoexcept |
Overrides std::exception::what()
|
private |