title: C++11 std::async in Android NDK does not work
body: <p>I have tried to get following sample code working to know whether asynchronous programming is working in Android NDK. Though NDK has the STL <code>&lt;future&gt;</code> which gets recognized as a header, the <code>std::async</code> is not getting recognized are not getting recognized. The code I tried to use was the following:</p>
  
  <pre><code>#include &lt;future&gt;
  #include &lt;iostream&gt;
  
  struct Foo 
  {
    Foo() : data(0) {}
    void sum(int i) { data +=i;}
    int data;
  };
  
  int main()
  {
      Foo foo;
      auto f = std::async(&amp;Foo::sum, &amp;foo, 42);
      f.get();
      std::cout &lt;&lt; foo.data &lt;&lt; "\n";
  }
  </code></pre>
  
  <p>Also all the include paths have been set to the specified folder under Properties->Paths and Symbols</p>
  
  <pre><code>Errors
  Description Resource    Path    Location    Type
  invalid use of incomplete type 'std::__async_sfinae_helper&lt;void (Foo::*)(int), void (Foo::*)(int), Foo*, int&gt;::type {aka struct std::future&lt;void&gt;}' Sample.cpp  /Project12/jni  line 50 C/C++ Problem
  
  Description Resource    Path    Location    Type
  declaration of 'std::__async_sfinae_helper&lt;void (Foo::*)(int), void (Foo::*)(int), Foo*, int&gt;::type {aka struct std::future&lt;void&gt;}' Project12       line 111, external location: D:\android-ndk-r8e-windows-x86_64\android-ndk-r8e\sources\cxx-stl\gnu-libstdc++\4.6\include\future C/C++ Problem
  </code></pre>