24 #include <type_traits> 27 #define scast(x, y) static_cast<x>(y) 28 #define dcast(x, y) dynamic_cast<x>(y) 29 #define rcast(x, y) reinterpret_cast<x>(y) 33 #define DARK_BLUE(x) QString("<font color=#0000FF>") + x + QString("</font>") 34 #define LIGHT_BLUE(x) QString("<font color=#8888FF>") + x + QString("</font>") 36 #define CAR_RET QString("<br />") 37 #define BOLD(x) QString("<b>") + x + QString("</b>") 38 #define BLACK(x) QString("<font color=#000000>") + x + QString("</font>") 42 #define LINK(n, t, d, s) if(d) s=QString("<a href=\"t\">)") + LIGHT_BLUE(n) + QString("</a>"); \ 43 else s=QString("<a href=\"t\">)") + DARK_BLUE(n) + QString("</a>"); 45 #define SAYONARA_ORANGE_STR QString("#e8841a") 46 #define SAYONARA_ORANGE_COL QColor(232, 132, 26) 50 template<
typename TINT,
typename T>
51 typename std::enable_if<std::is_pointer<T>::value,
bool>::type
52 between( TINT idx,
const T& cont){
53 return (idx >= 0 && idx < static_cast<TINT>(cont->size()));
56 template<
typename TINT,
typename T>
57 typename std::enable_if<std::is_class<T>::value,
bool>::type
58 between( TINT idx,
const T& cont){
59 return (idx >= 0 && idx < static_cast<TINT>(cont.size()));
62 template<
typename TINT>
63 typename std::enable_if<std::is_integral<TINT>::value,
bool>::type
64 between( TINT idx, TINT max){
65 return (idx >= 0 && idx < max);
Helper functions.
Definition: GenreView.h:35