<div dir="ltr"><div><div>I must be going blind or something because I cannot see the error here.</div><div><br></div><div><font face="monospace, monospace">sourceCpp(code = '</font></div><div><font face="monospace, monospace">// [[Rcpp::depends(BH)]]</font></div><div><font face="monospace, monospace">// [[Rcpp::plugins(cpp11)]]</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">#include <vector></font></div><div><font face="monospace, monospace">#include <boost/geometry.hpp></font></div><div><font face="monospace, monospace">#include <boost/geometry/geometries/point_xy.hpp></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">using key_type = boost::geometry::model::d2::point_xy<double>;</font></div><div><font face="monospace, monospace">using range_type = std::vector<key_type>;</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">range_type data;</font></div><div><font face="monospace, monospace">data.reserve(1e6);</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">for (int i = 0; i != 1e6; ++i)</font></div><div><font face="monospace, monospace">  data.emplace_back(R::runif(), R::runif());</font></div><div><font face="monospace, monospace">')</font></div></div><div><br></div>I get:<div><br></div><div><div><font face="monospace, monospace">filefc2f3edf6585.cpp:13:1: error: unknown type name 'data'</font></div><div><font face="monospace, monospace">data.reserve(1e6);</font></div><div><font face="monospace, monospace">^</font></div><div><font face="monospace, monospace">filefc2f3edf6585.cpp:13:5: error: cannot use dot operator on a type</font></div><div><font face="monospace, monospace">data.reserve(1e6);</font></div><div><font face="monospace, monospace">    ^</font></div><div><font face="monospace, monospace">filefc2f3edf6585.cpp:15:1: error: expected unqualified-id</font></div><div><font face="monospace, monospace">for (int i = 0; i != 1e6; ++i)</font></div><div><font face="monospace, monospace">^</font></div><div><font face="monospace, monospace">3 errors generated.</font></div><div><font face="monospace, monospace">make: *** [filefc2f3edf6585.o] Error 1</font></div><div><br></div><div>Must be something trivial I am not seeing. Anyone else see something I'm doing wrong?</div><div><br></div><div>THK</div><div><br></div><div><div class="gmail_signature"><div dir="ltr"><a href="http://www.keittlab.org/" target="_blank">http://www.keittlab.org/</a></div></div></div>
</div></div>