1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
error: taking address of temporary [-fpermissive]
rtices, sizeof(int), &[](auto a, auto b){ return ( *(int*)a - *(int*)b ); });
^
Graph.cpp:103:53: error: cannot convert ‘Graph::insert()::<lambda(auto:1, auto:2)>*’ to ‘__compar_fn_t’ {aka ‘int (*)(const void*, const void*)’}
qsort(this->nodes, this->vertices, sizeof(int), &[](auto a, auto b){ return ( *(int*)a - *(int*)b ); });
In file included from /usr/include/c++/8/cstdlib:75,
from /usr/include/c++/8/ext/string_conversions.h:41,
from /usr/include/c++/8/bits/basic_string.h:6400,
from /usr/include/c++/8/string:52,
from Graph.hpp:5,
from Graph.cpp:4:
/usr/include/stdlib.h:828:20: note: initializing argument 4 of ‘void qsort(void*, size_t, size_t, __compar_fn_t)’
__compar_fn_t __compar) __nonnull ((1, 4));
|