还未解决!!!
#include
#include
#include
using namespace std;
template
struct greator
{
bool operator()(const T &x, const T &y)
{
return x > y;
}
};
//class great : public greator
//{};
//class Foo
//{
// std::set<const great*, greator::less> _map;
//};
int main(void)
{
set<int, greator> iset;
iset.insert(12);
iset.insert(1);
iset.insert(24);
for (set<int>::const_iterator iter = iset.begin(); iter != iset.end(); iter++)
{
cout << *iter << " ";
}
cout << endl;
system("pause");
return 0;
}
/* 错误:static assertion failed: comparison object must be invocable as const
780 | is_invocable_v<const _Compare&, const _Key&, const _Key&>,
//https://gcc.gnu.org/gcc-8/porting_to.html
Porting to GCC 8
The GCC 8 release series differs from previous GCC releases in a number of ways. Some of these are a result of bug fixing, and some old behaviors have been intentionally changed to support new standards, or relaxed in standards-conforming ways to facilitate compilation or run-time performance.
Some of these changes are user visible and can cause grief when porting to GCC 8. This