34 |
34 |
35 // Converts a float value to a string value. |
35 // Converts a float value to a string value. |
36 str ftoa (double fCoord); |
36 str ftoa (double fCoord); |
37 |
37 |
38 template<class T> bool in (T needle, std::initializer_list<T> haystack) { |
38 template<class T> bool in (T needle, std::initializer_list<T> haystack) { |
39 for (size_t i = 0; i < haystack.size(); ++i) |
39 for (T hay : haystack) { |
40 if (needle = *(haystack.begin() + i)) |
40 printf ("%s: %ld <-> %ld\n", __func__, needle, hay); |
|
41 if (needle == hay) |
41 return true; |
42 return true; |
|
43 } |
42 |
44 |
43 return false; |
45 return false; |
44 } |
46 } |
45 |
47 |
46 // ============================================================================= |
48 // ============================================================================= |