SoldierTransformations don't compile:
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp: In member function ‘void OpenXcom::SoldierTransformationState::performTransformation()’:
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:339:160: error: no matching function for call to ‘find(std::vector<OpenXcom::Soldier*>::iterator, std::vector<OpenXcom::Soldier*>::iterator, OpenXcom::Soldier*&)’
std::vector<Soldier*>::iterator it = find(_game->getSavedGame()->getDeadSoldiers()->begin(), _game->getSavedGame()->getDeadSoldiers()->end(), _sourceSoldier);
^
In file included from /usr/include/c++/7/bits/locale_facets.h:48:0,
from /usr/include/c++/7/bits/basic_ios.h:37,
from /usr/include/c++/7/ios:44,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:20:
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: candidate: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)
find(istreambuf_iterator<_CharT> __first,
^~~~
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed:
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:339:160: note: ‘__gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*> >’ is not derived from ‘std::istreambuf_iterator<_CharT>’
std::vector<Soldier*>::iterator it = find(_game->getSavedGame()->getDeadSoldiers()->begin(), _game->getSavedGame()->getDeadSoldiers()->end(), _sourceSoldier);
^
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp: In member function ‘void OpenXcom::SoldierTransformationState::btnLeftArrowClick(OpenXcom::Action*)’:
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:364:132: error: no matching function for call to ‘find(std::vector<OpenXcom::Soldier*>::iterator, std::vector<OpenXcom::Soldier*>::iterator, OpenXcom::Soldier*&)’
std::vector<Soldier*>::const_iterator iter = find(_filteredListOfSoldiers->begin(), _filteredListOfSoldiers->end(), _sourceSoldier);
^
In file included from /usr/include/c++/7/bits/locale_facets.h:48:0,
from /usr/include/c++/7/bits/basic_ios.h:37,
from /usr/include/c++/7/ios:44,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:20:
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: candidate: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)
find(istreambuf_iterator<_CharT> __first,
^~~~
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed:
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:364:132: note: ‘__gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*> >’ is not derived from ‘std::istreambuf_iterator<_CharT>’
std::vector<Soldier*>::const_iterator iter = find(_filteredListOfSoldiers->begin(), _filteredListOfSoldiers->end(), _sourceSoldier);
^
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp: In member function ‘void OpenXcom::SoldierTransformationState::btnRightArrowClick(OpenXcom::Action*)’:
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:381:132: error: no matching function for call to ‘find(std::vector<OpenXcom::Soldier*>::iterator, std::vector<OpenXcom::Soldier*>::iterator, OpenXcom::Soldier*&)’
std::vector<Soldier*>::const_iterator iter = find(_filteredListOfSoldiers->begin(), _filteredListOfSoldiers->end(), _sourceSoldier);
^
In file included from /usr/include/c++/7/bits/locale_facets.h:48:0,
from /usr/include/c++/7/bits/basic_ios.h:37,
from /usr/include/c++/7/ios:44,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:20:
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: candidate: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)
find(istreambuf_iterator<_CharT> __first,
^~~~
/usr/include/c++/7/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed:
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:381:132: note: ‘__gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*> >’ is not derived from ‘std::istreambuf_iterator<_CharT>’
std::vector<Soldier*>::const_iterator iter = find(_filteredListOfSoldiers->begin(), _filteredListOfSoldiers->end(), _sourceSoldier);
^
I'm not quite capable to decipher this vomit right now, will appreciate any help.
$ gcc --version
gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
EDIT:
Even better, after adding an #include <algorithm>:
In file included from /usr/include/c++/7/bits/stl_algobase.h:71:0,
from /usr/include/c++/7/vector:60,
from /home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/../Engine/State.h:20,
from /home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.h:20,
from /home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:19:
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Iter_equals_val<_Value>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*> >; _Value = const OpenXcom::Soldier]’:
/usr/include/c++/7/bits/stl_algo.h:120:14: required from ‘_RandomAccessIterator std::__find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, std::random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*> >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const OpenXcom::Soldier>]’
/usr/include/c++/7/bits/stl_algo.h:161:23: required from ‘_Iterator std::__find_if(_Iterator, _Iterator, _Predicate) [with _Iterator = __gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*> >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const OpenXcom::Soldier>]’
/usr/include/c++/7/bits/stl_algo.h:3907:28: required from ‘_IIter std::find(_IIter, _IIter, const _Tp&) [with _IIter = __gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*> >; _Tp = OpenXcom::Soldier]’
/home/lxnt/projects/MerCOM/16B/OpenXcom/src/Basescape/SoldierTransformationState.cpp:366:133: required from here
/usr/include/c++/7/bits/predefined_ops.h:241:17: error: no match for ‘operator==’ (operand types are ‘OpenXcom::Soldier*’ and ‘const OpenXcom::Soldier’)
{ return *__it == _M_value; }
~~~~~~^~~~~~~~~~~
I'm at a loss for words.
EDIT2:
Okay, that was my fault.
But if anyone ever complains about how Rust craps out at every imagined opportunity to compared to... well, I'll tell'em to just go back to their BASIC.
@Meridian, please merge
--- a/src/Basescape/SoldierTransformationState.cpp
+++ b/src/Basescape/SoldierTransformationState.cpp
@@ -37,6 +37,7 @@
#include "../Savegame/SavedGame.h"
#include "../Savegame/Soldier.h"
#include "../Savegame/Transfer.h"
+#include <algorithm>
namespace OpenXcom
{
or it just doesn't build on recent compilers.