|
|
void my_sort() {sort(mpV, mpV + mSize, Toto::is_higher);} // #include
make all Building file: ../src/test.cpp Invoking: GCC C++ Compiler g++ -I"/home/alain/Documents/Poker/WorkSpace/MyUtils" -Ipthread -I/usr/include/tbb -O3 -Wall -c -fmessage-length=0 -std=c++0x -std=gnu++0x -MMD -MP -MF"src/test.d" -MT"src/test.d" -o"src/test.o" "../src/test.cpp" ../src/test.cpp: In member function 'void Toto::my_sort()': ../src/test.cpp:45:50: erreur: argument of type 'bool (Toto::)(int, int)' does not match 'bool (Toto::*)(int, int)' In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/algorithm:63:0, from ../src/test.cpp:16: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/bits/stl_algo.h: In function 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*, _Compare = bool (Toto::*)(int, int)]': /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/bits/stl_algo.h:2192:4: instantiated from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*, _Compare = bool (Toto::*)(int, int)]' /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/bits/stl_algo.h:5252:4: instantiated from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*, _Compare = bool (Toto::*)(int, int)]' |
|
|
static bool is_higher(int a1, int a2) {if (mSize == 5) return (a1 > a2); else return (false);}
make all Building file: ../src/test.cpp Invoking: GCC C++ Compiler g++ -I"/home/alain/Documents/Poker/WorkSpace/MyUtils" -Ipthread -I/usr/include/tbb -O3 -Wall -c -fmessage-length=0 -std=c++0x -std=gnu++0x -MMD -MP -MF"src/test.d" -MT"src/test.d" -o"src/test.o" "../src/test.cpp" ../src/test.cpp: In static member function 'static bool Toto::is_higher(int, int)': ../src/test.cpp:42:6: erreur: invalid use of member 'Toto::mSize' in static member function ../src/test.cpp:47:45: erreur: à partir de cette localisation ../src/test.cpp:47:95: attention : contrôle a atteint la fin non void de la fonction make: *** [src/test.o] Erreur 1 |
|
|
|
|
|
|
const
qualifier.
|
|
'placeholders' is not a namespace-name |
#include <thread>
|
|
#include <thread>
- you don't need it.#include <functional>
- you do need it for std::bind()
and std::placeholders