<div dir="ltr">Just want to add that you'll have more chance to get answer if you can give us a  reproductible, simple example of this problem.<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 2, 2013 at 11:32 AM, Robin Girard <span dir="ltr"><<a href="mailto:robin.girard@mines-paristech.fr" target="_blank">robin.girard@mines-paristech.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hello list,<br>
I'm having troubles using module on a class that redefines a vector of Mytype where Mytype is type that has several children types. Mytype has only methods while cihldren inherit methods and have fields that are double or integer or string.<br>

<br>
- when I remove inheritance everything work fine.<br>
- with inheritance, when I remove the push_back function redeclaration everything works fine (only with access methods size, vec_get, and constructors)<br>
- I am using the .derives in the module definitions<br>
<br>
I understand that I fully fall into the known shortcomming annouced in the Rcpp module vignette, I have tryed to read more about wrap (where my problem seems to be) digging into RcppArmadillo and RcppGSL, but it's a bit over my level of understanding for now since I'm new to cpp and don't fully understand template programming. I would like to know if there is a simple workaround in my case.<br>

<br>
The end of the error message in case this helps (Mytype is consumptionMean):<br>
<br>
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/internal/wrap.h:882:96:   instantiated from 'SEXPREC* Rcpp::module_wrap(const T&) [with T = consumptionMean, SEXP = SEXPREC*]'<br>
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/module/Module_generated_CppMethod.h:104:138:   instantiated from 'SEXPREC* Rcpp::CppMethod1<Class, OUT, U0>::operator()(Class*, SEXPREC**) [with Class = consumptionMean_vec, OUT = consumptionMean, U0 = int, SEXP = SEXPREC*]'<br>

Mymodules.cc:84:1:   instantiated from here<br>
C:/R/R-2.15.2/library/Rcpp/include/Rcpp/internal/wrap.h:451:11: error: passing 'const consumptionMean' as 'this' argument of 'consumptionMean::operator SEXP()' discards qualifiers<br>
<br>
Best<br>
R.<br>
<br>
Dr. Girard Robin<br>
Chargé de Recherche<br>
<br>
MINES-ParisTech / Département Energétique et Procédés / PERSEE / Groupe ERSEI<br>
Centre Procédés, Energies Renouvelables et Systèmes Energétiques (PERSEE)<br>
Center for Processes, Renewables Energies and Energy Systems<br>
Renewable Energies & Smartgrids (ERSEI)<br>
<br>
1 Rue Claude Daunesse - CS 10207 - F-06904 Sophia Antipolis Cedex<br>
Tel: +33.4.93.67.89.64 (~99), Fax: +33.4.93.95.75.35<br>
e-mail : <a href="mailto:robin.girard@mines-paristech.fr">robin.girard@mines-paristech.fr</a><br>
<br>
web page perso <a href="http://www.mines-paristech.fr/Services/Annuaire/&?id=8828" target="_blank">http://www.mines-paristech.fr/Services/Annuaire/&?id=8828</a><br>
statoverflow : <a href="http://stats.stackexchange.com/users/223/robin-girard" target="_blank">http://stats.stackexchange.com/users/223/robin-girard</a><br>
web page centre PERSEE : <a href="http://www.cep.mines-paristech.fr/" target="_blank">http://www.cep.mines-paristech.fr/</a><br>
linkedin : <a href="http://www.linkedin.com/profile/view?id=14907272&trk=tab_pro" target="_blank">http://www.linkedin.com/profile/view?id=14907272&trk=tab_pro</a><br>
<br>
Le lien vaut mieux que le bien.<br>
________________________________________________________<br>
<br>
CONFIDENTIALITY : This  e-mail  and  any attachments are<br>
confidential and may be privileged. If  you are not a<br>
named recipient, please notify the sender immediately and<br>
do not disclose the contents to another person, use it for<br>
any purpose or store or copy the information in any medium.<br>
<br>
CONFIDENTIALITE : Ce message et les éventuelles pièces<br>
attachées sontconfidentiels et peuvent être une<br>
communication protégée. Si vous n'êtes pas dans la liste<br>
des destinataires, veuillez informer l'expéditeur<br>
immédiatement et ne pas ouvrir ni divulguer le contenu<br>
à une tierce personne, ne pas l'utiliser pour quelque<br>
raison que ce soit, ne pas stocker ou copier l'information<br>
qu'il contient sur un quelconque support.<br>
<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></blockquote></div><br><br clear="all"><br>-- <br>
Ahmadou H. DICKO<br>Data scientist and applied economist<br>PhD student in Climate change economics<br>Faculty of economics and managment - Cheikh Anta Diop University<br>West African Science Service Center on Climate Change and Adaptated Land Use (WASCAL)<br>
Center for Development Research (ZEF) - University of Bonn <br>twitter : @dickoah<br>github : github/dickoa<br>tel : +221 33 827 55 16<br>portable: +221 77 123 81 69<br>
</div>