Is it possible with Rcpp Modules to have a class that does not have a default constructor? Consider this example<div><div>-----</div><div><div>#include <R.h></div><div>#include <Rcpp.h></div><div>class c1{</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>private:</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>int n;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>int * x;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>c1();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public:</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>c1(int n):n(n){}</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>int getn(){return n;}</div><div>};</div><div>RCPP_MODULE(c1){</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>using namespace Rcpp;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>class_<c1>("c1")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>.property("n",&c1::getn)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;</div>
<div>}</div></div></div><div>-----</div><div>Here I have a class that I do not want to allow to initialize without specifying n. Yes it does not do anything but the question is related to a class where constructors and destructors allocate and free special memory. And Yes I know that this fails on compile since c1() is private. Can Rcpp handle this kind of setup? If not suggestions about workarounds?</div>
<div><br></div><div>thanks,</div><div>Andrew</div>