I tried to use std::function in my project, having read here and there that C++ 11 is quite well supported. However simply using std::function makes the build fail:
[armeabi] Compile++ thumb: MyAppNative <= MyAppNative.cpp
jni/MyAppNative.cpp: In function 'jint JNI_OnLoad(JavaVM*, void*)':
jni/MyAppNative.cpp:7:2: error: 'function' is not a member of 'std'
std::function<void()> func;
^
jni/MyAppNative.cpp:7:24: error: 'func' was not declared in this scope
std::function<void()> func;
^
make: *** [obj/local/armeabi/objs/MyAppNative/MyAppNative.o] Error 1
My question is: is std::function supposed to be supported? I've seen it conditionally defined in the header, depending on _STLP_USE_BOOST_SUPPORT. Is that normal? I have attached a sample project if anyone is interested in testing.
http://www.filedropper.com/cpp11-functional-issue
Cheers
-std=c++11
flag when building? Which version of GCC is used?