sources/basics.h

changeset 14
33b8f428bacb
parent 5
146825d63b9a
child 15
33da84af4bba
equal deleted inserted replaced
13:09dcaeaa216b 14:33b8f428bacb
29 */ 29 */
30 30
31 #pragma once 31 #pragma once
32 #include <algorithm> 32 #include <algorithm>
33 #include <functional> 33 #include <functional>
34 #include <memory>
34 35
35 #define FUNCTION auto 36 #define FUNCTION auto
36 #define STATIC 37 #define STATIC
37 #define METHOD auto 38 #define METHOD auto
38 #define MACRO_TO_STRING_2(A) #A 39 #define MACRO_TO_STRING_2(A) #A
39 #define MACRO_TO_STRING(A) MACRO_TO_STRING_2(A) 40 #define MACRO_TO_STRING(A) MACRO_TO_STRING_2(A)
40 41
42 class String;
43
41 using std::swap; 44 using std::swap;
42 using std::min; 45 using std::min;
43 using std::max; 46 using std::max;
47
48 template<typename T>
49 using SharedPointer = std::shared_ptr<T>;
50
51 template<typename T>
52 using WeakPointer = std::weak_ptr<T>;
44 53
45 enum Color 54 enum Color
46 { 55 {
47 BLACK, 56 BLACK,
48 RED, 57 RED,
57 NUM_COLORS 66 NUM_COLORS
58 }; 67 };
59 68
60 template<typename Signature> 69 template<typename Signature>
61 using Function = std::function<Signature>; 70 using Function = std::function<Signature>;
71
72 FUNCTION print_to_console (const String& a) -> void;

mercurial