Optional parameters: Difference between revisions
Content added Content deleted
(→{{header|Go}}: added quotes to output) |
|||
Line 325: | Line 325: | ||
struct sort_table_functor { |
struct sort_table_functor { |
||
typedef bool (*CompFun)(const T &, const T &); |
typedef bool (*CompFun)(const T &, const T &); |
||
CompFun ordering; |
const CompFun ordering; |
||
int column; |
const int column; |
||
bool reverse; |
const bool reverse; |
||
sort_table_functor(CompFun o, int c, bool r) : |
sort_table_functor(CompFun o, int c, bool r) : |
||
ordering(o), column(c), reverse(r) { } |
ordering(o), column(c), reverse(r) { } |
||
bool operator()(const std::vector<T> &x, const std::vector<T> &y) { |
bool operator()(const std::vector<T> &x, const std::vector<T> &y) const { |
||
const T &a = x[column], |
const T &a = x[column], |
||
&b = y[column]; |
&b = y[column]; |