-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.hpp
26 lines (24 loc) · 830 Bytes
/
main.hpp
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
#ifndef __MAIN__
#define __MAIN__
#ifdef _MSC_VER
#define __PTRDIFF_TYPE__ ptrdiff_t
#include <string>
#endif
const static string SEPARATOR = "------------------------------------------";
/*
template <typename Parent, typename Child>
inline __PTRDIFF_TYPE__ offset_of_base(Child &child) {
return abs((__PTRDIFF_TYPE__)&child - (__PTRDIFF_TYPE__)((Parent *)&child));
}
void printTitle(string name) {
size_t len = (SEPARATOR.length() - (name.length())) / 2;
string block = string(len, '-');
string title = block+name+block;
if (title.length() < SEPARATOR.length()) {
title += string(SEPARATOR.length() - title.length(), '-');
}
cout << SEPARATOR << endl;
cout << title << endl;
cout << SEPARATOR << endl;
}*/
#endif // __MAIN__