In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62:0,
from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = Minister*; _Tp = Minister; _Compare = bool (*)(Minister&, Minister&)]':
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:2319:78: required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Minister*; _Compare = bool (*)(Minister&, Minister&)]'
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:2360:62: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = Minister*; _Size = int; _Compare = bool (*)(Minister&, Minister&)]'
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:5513:44: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = Minister*; _Compare = bool (*)(Minister&, Minister&)]'
foo.cpp:41:26: required from here
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:2287:35: error: invalid initialization of reference of type 'Minister&' from expression of type 'const Minister'
while (__comp(*__first, __pivot))
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:2290:34: error: invalid initialization of reference of type 'Minister&' from expression of type 'const Minister'
while (__comp(__pivot, *__last))
^