put include all into its own header

This commit is contained in:
Johannes Kapfhammer 2019-10-06 17:19:10 +02:00
parent d8a3ccc553
commit 3d1c648b4f
3 changed files with 48 additions and 28 deletions

View File

@ -0,0 +1,39 @@
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <deque>
#include <forward_list>
#include <fstream>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <memory>
#include <ostream>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201703L
#include <any>
#include <optional>
#include <string_view>
#include <variant>
#endif

View File

@ -14,6 +14,8 @@
#include <stdexcept> #include <stdexcept>
#include <cstring> #include <cstring>
#include <ostream> #include <ostream>
#include <iostream>
#include <sstream>
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#include <unistd.h> #include <unistd.h>

View File

@ -5,33 +5,11 @@
have to understand every concept all at once. have to understand every concept all at once.
*/ */
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <fstream> #include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <memory>
#include <ostream>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <vector>
#include "bits/soi-dbg.hpp" #include "bits/soi-dbg.hpp"
namespace soi_h { namespace soi_h {
void check_for_eof() { void check_for_eof() {
if (!(std::cin >> std::ws).eof()) if (!(std::cin >> std::ws).eof())
std::cerr << "WARNING: didn't read the whole input\n"; std::cerr << "WARNING: didn't read the whole input\n";
@ -69,14 +47,14 @@ void initialize_debug() {
std::cout << std::unitbuf; // enable automatic flushing std::cout << std::unitbuf; // enable automatic flushing
std::cin.exceptions(std::ifstream::failbit | std::ifstream::badbit); std::cin.exceptions(std::ifstream::failbit | std::ifstream::badbit);
std::ios::sync_with_stdio(false); std::ios::sync_with_stdio(false);
if (should_check_for_eof() && if (should_check_for_eof() &&
std::atexit(noninteractive_check_eof) != 0) { std::atexit(noninteractive_check_eof) != 0) {
std::cerr << "WARNING: soi.h -- registration of sanity check at exit failed\n"; std::cerr << "WARNING: soi.h -- registration of sanity check at exit failed\n";
} }
soi_h::detail::dbg_init(); soi_h::detail::dbg_init();
} }
struct soi_h_initializer { struct soi_h_initializer {
soi_h_initializer(bool release) { soi_h_initializer(bool release) {
if (release) { if (release) {
@ -93,11 +71,12 @@ soi_h_initializer soi_h_initializer_{true};
#else #else
soi_h_initializer soi_h_initializer_{false}; soi_h_initializer soi_h_initializer_{false};
#endif #endif
} // end namespace soi_h } // end namespace soi_h
#include "bits/soi-deprecate.hpp" #include "bits/soi-deprecate.hpp"
#include "bits/include-all.hpp"
#define int int64_t #define int int64_t
using namespace std; using namespace std;