KSS Utility
C++ general utilities
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
utility.hpp
Go to the documentation of this file.
1 //
2 // utility.hpp
3 // kssutil
4 //
5 // Created by Steven W. Klassen on 2019-01-17.
6 // Copyright © 2019 Klassen Software Solutions. All rights reserved.
7 // Licensing follows the MIT License.
8 //
9 
10 #ifndef kssutil_utility_hpp
11 #define kssutil_utility_hpp
12 
13 #include <exception>
14 #include <iostream>
15 
16 namespace kss { namespace util {
17 
18  namespace _private {
19  // Use these macros if a condition fails in a header file. (In a cpp file
20  // use the contract API.)
21 # define _KSSUTIL_PRECONDITIONS_FAILED { std::cerr << "preconditions failed " << __FILE__ << ", " << __LINE__ << std::endl; std::terminate(); }
22 # define _KSSUTIL_POSTCONDITIONS_FAILED { std::cerr << "postconditions failed " << __FILE__ << ", " << __LINE__ << std::endl; std::terminate(); }
23  }
24 }}
25 
26 #endif