-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstd_lib_facilities.h
More file actions
37 lines (27 loc) · 855 Bytes
/
std_lib_facilities.h
File metadata and controls
37 lines (27 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// This is a standard library support code to the chapters of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#ifndef STD_LIB_FACILITIES_GUARD
#define STD_LIB_FACILITIES_GUARD 1
#include <cmath>
#include <cstring>
#include <fstream>
#include <stdexcept>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
//------------------------------------------------------------------------------
// Helper function to show an error message
inline void error(const string& errormessage)
{
throw runtime_error(errormessage);
}
//------------------------------------------------------------------------------
inline void error(string s1, string s2)
{
error(s1+s2);
}
//------------------------------------------------------------------------------
#endif // STD_LIB_FACILITIES_GUARD