File indexing completed on 2026-08-06 09:38:20
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ThePEG_std_H
0010 #define ThePEG_std_H
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #include <map>
0026 #include <set>
0027 #include <string>
0028 #include <array>
0029 #include <vector>
0030 #include <list>
0031 #include <iostream>
0032 #include <fstream>
0033 #include <sstream>
0034 #include <iomanip>
0035 #include <stack>
0036 #include <utility>
0037 #include <typeinfo>
0038 #include <stdexcept>
0039 #include <cmath>
0040
0041 namespace std {
0042
0043
0044
0045
0046
0047
0048
0049 template <>
0050 struct less<const type_info *> {
0051
0052
0053
0054
0055 typedef type_info first_argument_type;
0056 typedef type_info second_argument_type;
0057 typedef bool result_type;
0058 bool operator()(const type_info * x, const type_info * y) const {
0059 return x->before(*y); }
0060 };
0061
0062
0063 }
0064
0065 namespace ThePEG {
0066
0067 using std::array;
0068 using std::deque;
0069 using std::stack;
0070 using std::vector;
0071 using std::multiset;
0072 using std::set;
0073 using std::map;
0074 using std::list;
0075 using std::multimap;
0076 using std::pair;
0077 using std::make_pair;
0078 using std::less;
0079 using std::string;
0080 using std::type_info;
0081 using std::exception;
0082 using std::range_error;
0083 using std::ios;
0084 using std::ostream;
0085 using std::istream;
0086 using std::ofstream;
0087 using std::ifstream;
0088 using std::ostringstream;
0089 using std::istringstream;
0090 using std::cin;
0091 using std::cout;
0092 using std::cerr;
0093 using std::endl;
0094 using std::flush;
0095 using std::setprecision;
0096 using std::setw;
0097 using std::swap;
0098 using std::min;
0099 using std::max;
0100 using std::mem_fn;
0101 using std::mem_fun;
0102 using std::sqrt;
0103
0104 using std::abs;
0105 using std::atan2;
0106 using std::isfinite;
0107
0108
0109 template <class ExponentT>
0110 inline constexpr double pow(double x, ExponentT p) {
0111 return std::pow(x,double(p));
0112 }
0113
0114
0115 inline double sqrt(int x) {
0116 return std::sqrt(double(x));
0117 }
0118
0119
0120 inline constexpr long double factorial(unsigned int n) {
0121 return (n < 2) ? 1.0 : n * factorial(n - 1);
0122 }
0123
0124
0125 template <typename Container, typename Key>
0126 inline bool member(const Container & c, const Key & k) {
0127 return c.find(k) != c.end();
0128 }
0129
0130
0131 template <typename T, typename Key>
0132 inline bool member(const vector<T> & v, const Key & k) {
0133 for ( typename vector<T>::const_iterator i = v.begin(); i != v.end(); ++i )
0134 if ( *i == k ) return true;
0135 return false;
0136
0137 }
0138
0139
0140 template <typename Cont>
0141 inline std::insert_iterator<Cont> inserter(Cont & c) {
0142 return std::insert_iterator<Cont>(c, c.end());
0143 }
0144
0145
0146
0147
0148 template <typename T, typename A>
0149 inline std::back_insert_iterator< vector<T,A> > inserter(vector<T,A> & v) {
0150 return back_inserter(v);
0151 }
0152
0153
0154
0155 template <typename T, typename A>
0156 inline std::back_insert_iterator< deque<T,A> > inserter(deque<T,A> & v) {
0157 return back_inserter(v);
0158 }
0159
0160
0161 inline ostream& left(ostream& os) {
0162 os.setf(ios::left, ios::adjustfield);
0163 return os;
0164 }
0165
0166
0167 inline ostream& right(ostream& os) {
0168 os.setf(ios::right, ios::adjustfield);
0169 return os;
0170 }
0171
0172 }
0173
0174
0175 #define ThePEG_DECLARE_SET(VALTYPE,NAME) \
0176 \
0177 typedef set<VALTYPE, less<VALTYPE> > NAME
0178
0179
0180 #define ThePEG_DECLARE_MULTISET(VALTYPE,NAME) \
0181 \
0182 typedef multiset<VALTYPE, less<VALTYPE> > NAME
0183
0184
0185 #define ThePEG_DECLARE_MAP(KEYTYPE,VALTYPE,NAME) \
0186 \
0187 typedef map<KEYTYPE, VALTYPE, less<KEYTYPE> > NAME
0188
0189 #endif