You may need to update the compiler to a more modern version and/or explicitly instruct it to conform to C++11.
for example, with: g++ -std=c++11 -pedantic-errors
I compiled this in MinGW 4.8 gcc and it works fine, different results with NDK g++.
@lastchance
reverse_iterator without the const should be fine unless you are obsessed with ensuring nothing gets changed in the loop.
I see and will just check if it affects the results.
I am using Android 21 and have added the NDK_TOOLCHAIN_VERSION := 4.9 and APP_CPPFLAGS += -std=c++11 on my Android.mk file, but still getting these errors.
You may need to update the compiler to a more modern version and/or explicitly instruct it to conform to C++11.
for example, with: g++ -std=c++11 -pedantic-errors
I see and thanks for the confirmation. I have added the c++11 flags but still getting errors.
By checking again the guide here, I just changed stlport_static which is set and default to the project library that I am using to gnustl_static and it worked!
APP_STL := gnustl_static
I also tested it without the 4.9 toolchain version and c++11 flags and it also works.
I am now thinking of whether to just ignore and use reverse_iterator instead if it does not make any difference or go for gnustl_static which is now untested to work with my project.
Edit: c++static also works and now I am concerned or puzzled why stlport which is widely used doesn't have it. btw, I am new to this stl android stuff.
and so I found out that stlport is BSD vs GPL3 gnustl.. ok that's why.