echelon  0.8.0
broken_contract_exception.hpp
1 // Copyright (c) 2012-2014 Christopher Hinz
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 #ifndef ECHELON_HDF5_BROKEN_CONTRACT_EXCEPTION_HPP
7 #define ECHELON_HDF5_BROKEN_CONTRACT_EXCEPTION_HPP
8 
9 #include <string>
10 #include <exception>
11 #include <utility>
12 
13 namespace echelon
14 {
15 namespace hdf5
16 {
20 class broken_contract_exception : public std::exception
21 {
22 public:
27  broken_contract_exception(std::string what_) : what_(std::move(what_))
28  {
29  }
30 
34  {
35  }
36 
39  const char* what() const noexcept override
40  {
41  return what_.c_str();
42  }
43 
44 private:
45  std::string what_;
46 };
47 }
48 }
49 
50 #endif
echelon&#39;s core namespace
Definition: attribute.cpp:10
const char * what() const noexceptoverride
An associated error description.
Definition: broken_contract_exception.hpp:39
~broken_contract_exception() noexcept
The destructor.
Definition: broken_contract_exception.hpp:33
broken_contract_exception(std::string what_)
Creates a new exception with a given error description.
Definition: broken_contract_exception.hpp:27
Exception, which is thrown, if a require_*-type method can&#39;t fulfill the contract.
Definition: broken_contract_exception.hpp:20