Hi All.
I trying to use:
struct FLess : public std::binary_function<HASH, HASH, bool>
{
int Col;
static void setCol( int C );
inline bool operator()( const HASH &rec1, const HASH &rec2 )
{
return ( rec1.hash.value( Col ) < rec2.hash.value( Col ) );
}
};
struct FLess : public std::binary_function<HASH, HASH, bool>
{
int Col;
static void setCol( int C );
inline bool operator()( const HASH &rec1, const HASH &rec2 )
{
return ( rec1.hash.value( Col ) < rec2.hash.value( Col ) );
}
};
To copy to clipboard, switch view to plain text mode
In programm:
FLess::setCol( 5 );
if (order == Qt::AscendingOrder)
std::sort( Records[i].begin(), Records[i].end(), FLess() );
FLess::setCol( 5 );
if (order == Qt::AscendingOrder)
std::sort( Records[i].begin(), Records[i].end(), FLess() );
To copy to clipboard, switch view to plain text mode
How make sort by Col?
Thanks.
Bookmarks