sources/format.h

changeset 11
cffa2777d917
parent 10
3874575d924d
child 14
33b8f428bacb
equal deleted inserted replaced
10:3874575d924d 11:cffa2777d917
31 #pragma once 31 #pragma once
32 #include "mystring.h" 32 #include "mystring.h"
33 #include "basics.h" 33 #include "basics.h"
34 #include "geometry.h" 34 #include "geometry.h"
35 35
36 #define FORMAT_OVERLOAD(T) \ 36 #define FORMAT_OVERLOAD(...) \
37 inline FUNCTION make_format_argument (T a) -> String 37 inline FUNCTION make_format_argument (__VA_ARGS__ a) -> String
38 38
39 // 39 //
40 // ------------------------------------------------------------------------------------------------- 40 // -------------------------------------------------------------------------------------------------
41 // 41 //
42 42
55 String result; 55 String result;
56 result.sprintf ("%p", a); 56 result.sprintf ("%p", a);
57 return result; 57 return result;
58 } 58 }
59 59
60 template<typename T> 60 template<typename T, typename C>
61 FORMAT_OVERLOAD (const List<T>&) 61 FORMAT_OVERLOAD (const Container<T, C>&)
62 { 62 {
63 String result; 63 String result;
64 64
65 if (a.is_empty()) 65 if (a.is_empty())
66 return "{}"; 66 return "{}";

mercurial