Error compiling juce module for c++ 17
I am getting a compilation error when i set the language standard in the projucer from c++14 to c++17.
C2143 syntax error: missing ',' before '<' (compiling source file ....\JuceLibraryCode\include_rosic.cpp) Test_SharedCode c:\modules\rosic\datastructures\rosic_keyvaluemap.h 34
C2143 syntax error: missing ',' before '<' (compiling source file ....\JuceLibraryCode\include_rosic.cpp) Test_SharedCode c:\modules\rosic\datastructures\rosic_keyvaluemap.h 56
i don't have c++17 yet. do you know, how to fix it? then i will apply it
i didnt find a fix for that, what i ended up doing is comment out in rosic_KeyValueMap.h lines 33- 40 and lines 55-62:
template<class KeyType, class ValueType> struct KeyValuePairPointerLessByKey : std::binary_function<KeyValuePair<KeyType, ValueType>, KeyValuePair<KeyType, ValueType>, bool> { bool operator() (KeyValuePair<KeyType, ValueType>* pointer1, KeyValuePair<KeyType, ValueType>* pointer2) const { return keyValuePairPointerLessByKey(pointer1, pointer2); } };
template<class KeyType, class ValueType> struct KeyValuePairPointerLessByValue : std::binary_function<KeyValuePair<KeyType, ValueType>, KeyValuePair<KeyType, ValueType>, bool> { bool operator() (KeyValuePair<KeyType, ValueType>* pointer1, KeyValuePair<KeyType, ValueType>* pointer2) const { return keyValuePairPointerLessByValue(pointer1, pointer2); } };
oh - it seems to have to do with this std::binary_function which has been removed in c++17:
https://en.cppreference.com/w/cpp/utility/functional/binary_function
...so, commenting this code out works at the moment? i'm not sure, what i should use instead.. i'll figure this stuff out when moving on to c++17.