38#include <forward_list>
40#include<unordered_map>
70template<
class T>
struct Vector :
public std::vector<T> {
71 using size_type =
typename std::vector<T>::size_type;
82 using std::vector<T>::vector;
87 return std::vector<T>::operator[](i);
92 return std::vector<T>::operator[](i);
107 return std::string::operator[](i);
113 return std::string::operator[](i);
124 return hash<std::string>()(s);
132 Exit() : runtime_error(
"Exit") {}
138 throw runtime_error(
s);
141inline void error(
const string&
s,
const string&
s2)
149 os <<
s <<
": " <<
i;
158 return static_cast<char*
>(
addr);
165 cout <<
"Please enter a character to exit\n";
175 cin.ignore(120,
'\n');
177 cout <<
"Please enter " <<
s <<
" to exit\n";
180 cout <<
"Please enter " <<
s <<
" to exit\n";
190 cerr <<
"error: " <<
s <<
'\n';
204 if (
A(
r) !=
a)
error(
string(
"info loss"));
236 std::sort(
c.begin(),
c.end());
239template<
typename C,
typename Pred>
243 std::sort(
c.begin(),
c.end(),
p);
246template<
typename C,
typename Val>
250 return std::find(
c.begin(),
c.end(),
v);
253template<
typename C,
typename Pred>
257 return std::find_if(
c.begin(),
c.end(),
p);
typename C::value_type Value_type
default_random_engine & get_rand()
void error(const string &s)
string to_string(const T &t)
Iterator< C > find_if(C &c, Pred p)
void simple_error(string s)
Iterator< C > find(C &c, Val v)
typename C::iterator Iterator
R narrow_cast(const A &a)
int randint(int min, int max)
const char & operator[](unsigned int i) const
std::string::size_type size_type
char & operator[](unsigned int i)
typename std::vector< T >::size_type size_type
T & operator[](unsigned int i)
const T & operator[](unsigned int i) const
size_t operator()(const String &s) const