PageRenderTime 26ms CodeModel.GetById 15ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/prelude/prelude.hpp

http://github.com/Eelis/geordi
C++ Header | 199 lines | 185 code | 14 blank | 0 comment | 0 complexity | dacebd3ef664163ecb6d35672f9429e6 MD5 | raw file
  1#ifdef __clang__
  2  #include "libcxx_patched_typeinfo.hpp"
  3#else
  4  #include "libstdcxx_patched_typeinfo.hpp"
  5#endif
  6
  7#if __cplusplus >= 201103 // maybe backport parts of these even further someday
  8  #include "lvalue_rvalue.hpp"
  9  #include "bin_iomanip.hpp"
 10  #include "type_strings.hpp"
 11#endif
 12
 13#include "tracked.hpp"
 14#include "more_ostreaming.hpp"
 15#include "literal_escape.hpp"
 16#include "delimited_ostream.hpp"
 17#include "show.hpp"
 18#include "evil_casts.hpp"
 19#include "geordi.hpp"
 20#include "bark.hpp"
 21
 22#include <algorithm>
 23#include <bitset>
 24#include <complex>
 25#include <deque>
 26#include <exception>
 27#include <fstream>
 28#include <functional>
 29#include <iomanip>
 30#include <ios>
 31#include <iosfwd>
 32#include <iostream>
 33#include <istream>
 34#include <iterator>
 35#include <limits>
 36#include <list>
 37#include <locale>
 38#include <map>
 39#include <memory>
 40#include <new>
 41#include <numeric>
 42#include <ostream>
 43#include <queue>
 44#include <set>
 45#include <sstream>
 46#include <stack>
 47#include <stdexcept>
 48#include <strstream>
 49#include <streambuf>
 50#include <string>
 51#include <typeinfo>
 52#include <utility>
 53#include <valarray>
 54#include <vector>
 55#include <cassert>
 56#include <cctype>
 57#include <cerrno>
 58#include <cfloat>
 59#include <ciso646>
 60#include <climits>
 61#include <clocale>
 62#include <cmath>
 63#include <csetjmp>
 64#include <csignal>
 65#include <cstdarg>
 66#include <cstddef>
 67#include <cstdio>
 68#include <cstdlib>
 69#include <cstring>
 70#include <ctime>
 71#include <cwchar>
 72#include <cwctype>
 73
 74#if __cplusplus >= 201103
 75  #include <atomic>
 76  #include <codecvt>
 77  #include <thread>
 78  #include <regex>
 79  #include <condition_variable>
 80  #include <array>
 81  #include <chrono>
 82  #include <future>
 83  #include <mutex>
 84  #include <type_traits>
 85  #include <typeindex>
 86  #include <cfenv>
 87  #include <initializer_list>
 88  #include <tuple>
 89  #include <scoped_allocator>
 90  #include <random>
 91  #include <ratio>
 92  #include <cstdint>
 93  #include <cinttypes>
 94  #include <forward_list>
 95  #include <unordered_map>
 96  #include <unordered_set>
 97  #include <system_error>
 98#endif
 99
100#if __cplusplus >= 201703
101  #include <shared_mutex>
102  #include <any>
103  #include <optional>
104  #include <string_view>
105  #include <variant>
106
107  #if __has_include(<experimental/array>)
108    #include <experimental/array>
109  #endif
110  #if __has_include(<experimental/algorithm>)
111    #include <experimental/algorithm>
112  #endif
113  #if __has_include(<experimental/deque>)
114    #include <experimental/deque>
115  #endif
116  #if __has_include(<experimental/filesystem>)
117    #include <experimental/filesystem>
118  #endif
119  #if __has_include(<experimental/forward_list>)
120    #include <experimental/forward_list>
121  #endif
122  #if __has_include(<experimental/functional>)
123    #include <experimental/functional>
124  #endif
125  #if __has_include(<experimental/iterator>)
126    #include <experimental/iterator>
127  #endif
128  #if __has_include(<experimental/list>)
129    #include <experimental/list>
130  #endif
131  #if __has_include(<experimental/map>)
132    #include <experimental/map>
133  #endif
134  #if __has_include(<experimental/memory>)
135    #include <experimental/memory>
136  #endif
137  #if __has_include(<experimental/memory_resource>)
138    #include <experimental/memory_resource>
139  #endif
140  #if __has_include(<experimental/propagate_const>)
141    #include <experimental/propagate_const>
142  #endif
143  #if __has_include(<experimental/random>)
144    #include <experimental/random>
145  #endif
146  #if __has_include(<experimental/regex>)
147    #include <experimental/regex>
148  #endif
149  #if __has_include(<experimental/set>)
150    #include <experimental/set>
151  #endif
152  #if __has_include(<experimental/string>)
153    #include <experimental/string>
154  #endif
155  #if __has_include(<experimental/type_traits>)
156    #include <experimental/type_traits>
157  #endif
158  #if __has_include(<experimental/unordered_map>)
159    #include <experimental/unordered_map>
160  #endif
161  #if __has_include(<experimental/unordered_set>)
162    #include <experimental/unordered_set>
163  #endif
164  #if __has_include(<experimental/utility>)
165    #include <experimental/utility>
166  #endif
167  #if __has_include(<experimental/vector>)
168    #include <experimental/vector>
169  #endif
170#endif
171
172#if __cplusplus >= 201103
173  extern template class std::basic_ostream<char>;
174
175  extern template class std::basic_regex<char>;
176  extern template std::string std::regex_replace<std::regex_traits<char>, char>(
177    char const *, std::regex const &, char const *, std::regex_constants::match_flag_type);
178#endif
179
180char const help [] = "Mini-manual:  http://www.eelis.net/geordi/";
181
182#define RANGE(x) (::std::begin(x)), (::std::end(x))
183
184#define T(n) \
185  namespace std \
186  { template <typename C> \
187    std::istreambuf_iterator<C> boost_range_begin(n<C> & i) { return std::istreambuf_iterator<C>(i); } \
188    template <typename C> \
189    std::istreambuf_iterator<C> boost_range_end(n<C> &) { return std::istreambuf_iterator<C>(); } \
190  }
191
192T(basic_istream)
193T(basic_ifstream)
194T(basic_istringstream)
195
196#undef T
197
198#undef assert
199#define assert(e) ((e) ? void() : (::std::printf("%s", "Assertion `" #e "' fails."), ::std::fclose(stdout), ::std::abort()))