title: 'function' in namespace 'std' does not name a template type
body: <p>Using Rcpp package to include C++ in R, I tried to compile my C++ file. Here is the error that came:</p>
  
  <blockquote>
    <p>'function' in namespace 'std' does not name a template type</p>
  </blockquote>
  
  <p>After investigation, I have been told that my code used some functionalities that are only available from C++ 11. So I need to add one line in my Makevars file. However, I found a vignette that says Makevars is not mandatory anymore :<a href="https://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-package.pdf" rel="noreferrer">Rcpp vignette</a>. How can I fix this problem?</p>
  
  <p>Here is the part of the C++ script that doesn't work:</p>
  
  <pre><code>std::function&lt;void(const state_type, state_type, const double)&gt; eqsir2(const Rcpp::NumericVector theta) {
    return [&amp;theta](const state_type &amp;x, state_type &amp;dxdt, const double t) {
      boost_array_to_nvec2(x, nvec);
      my_fun22(nvec,t,theta);
      nvec_to_boost_array2(nvec, dxdt);
    }
  </code></pre>