In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/algorithm:63:0,
from foo.cpp:6:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = dat*; _Tp = dat; _Compare = int (*)(dat&, dat&)]':
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_algo.h:2321:78: required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = dat*; _Compare = int (*)(dat&, dat&)]'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_algo.h:2362:62: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = dat*; _Size = int; _Compare = int (*)(dat&, dat&)]'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_algo.h:5514:4: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = dat*; _Compare = int (*)(dat&, dat&)]'
foo.cpp:47:22: required from here
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_algo.h:2289:4: error: invalid initialization of reference of type 'dat&' from expression of type 'const dat'
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_algo.h:2292:4: error: invalid initialization of reference of type 'dat&' from expression of type 'const dat'