 class="header-section-number">18.3</span> Using <code>RObject</code> to write functions that receive various datatypes (function templates)</h2>
<p>C++ allows us to avoid code duplication by writing <a href="https://www.programiz.com/cpp-programming/templates">templated functions</a> that are not limited to specific datatypes.</p>
<p><strong>Note:</strong> This section does not cover C++ templates in any detail - it only shows how to implement them in Rcpp. It also assumes your compiler can use C++11 synta