<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas",serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi Kevin,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Yes, your understanding was correct
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">. My problem is I cannot w/o going deep into the logic of the implementation to get the intent and
 from it the type to cast. I am afraid I have to ask you: Are you sure size_t is the type to cast in the context of attributes.cpp? Otherwise by intuition I replaced 0U with 0UL (equivalent I believe, to size_t)  and it compiled.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">In the lack of understanding are there any ways to check the correctness of so installed package Rcpp?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Latchezar<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Kevin Ushey [mailto:kevinushey@gmail.com]
<br>
<b>Sent:</b> Saturday, April 18, 2015 11:15 PM<br>
<b>To:</b> Latchezar (Lucho) Dimitrov<br>
<b>Cc:</b> rcpp-devel@lists.r-forge.r-project.org<br>
<b>Subject:</b> Re: [Rcpp-devel] FW: Rcpp attributes.cpp issue<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">IIUC, from the build errors you're seeing, the compiler can't decide if it should convert `0U` (unsigned int) to an `unsigned long` or a `char*` (e.g. as a null pointer). In other words, these two overloads are competing:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<pre style="background:#FAFFFA"><span style="font-size:9.0pt;color:green">   void insert (iterator p, size_t n, char c);<o:p></o:p></span></pre>
<pre style="background:#FAFFFA"><span style="color:green">string& insert (size_t pos, size_t n, char c);<o:p></o:p></span></pre>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Most other standard library implementations have 'iterator' as a completely separate type from a plain `char*` pointer, to avoid things like this (since 0 can implicitly be converted to a pointer).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">To work around this (on Rcpp's side) I think we could cast `0` to a `std::size_t` in each call, or else perform what is essentially a 'push_front' in a separate way.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Kevin<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Sat, Apr 18, 2015 at 7:02 PM, Latchezar (Lucho) Dimitrov <<a href="mailto:ldimitro@wakehealth.edu" target="_blank">ldimitro@wakehealth.edu</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">OK. Here it is.<br>
<br>
Hi All,<br>
<br>
Please see bellow my original e-mail to Mr. Eddelbuettel.<br>
<br>
Help anyone? I do not need necessarily a Solaris user, rather someone who knows the actual types of 0U bellow or another way to resolve the ambiguity.<br>
<br>
Thanks a lot,<br>
Latchezar<br>
<br>
"<br>
Dear Mr. Eddelbuettel,<br>
<br>
I have just built R-3.1.2 on solaris 11.2 with solaris stufio 12.4. Then starting it from the build I tried to install Rcpp. I failed due to the following compilation errors:<br>
<br>
"attributes.cpp", line 1369: Error: Overloading ambiguity between "std::string::insert(char*, unsigned long, char)" and "std::string::insert(unsigned long, unsigned long, char)".<br>
"attributes.cpp", line 1378: Error: Overloading ambiguity between "std::string::insert(char*, unsigned long, char)" and "std::string::insert(unsigned long, unsigned long, char)".<br>
<br>
The lines in the code are:<br>
<br>
                        typeText.insert(0U, 1U, *it);<br>
and<br>
                name.insert(0U, 1U, ch);<br>
<br>
Apparently I have to specify the type of 0U argument. Would you please help?<br>
<br>
Thanks a lot,<br>
<br>
Latchezar Dimitrov,<br>
Analyst/Programmer, Wake Forest Univ. School of Medicine,<br>
Winston-Salem, NC<br>
U.S.A.<br>
"<br>
<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: Dirk Eddelbuettel [mailto:<a href="mailto:edd@debian.org">edd@debian.org</a>]<br>
Sent: Saturday, April 18, 2015 10:15 AM<br>
To: Latchezar (Lucho) Dimitrov<br>
Cc: <a href="mailto:edd@debian.org">edd@debian.org</a><br>
Subject: Re: Rcpp attributes.cpp issue<br>
<br>
<br>
I'd prefer the question on rcpp-devel. You may find a Solaris user there.<br>
<br>
Dirk<br>
<br>
<br>
Thank you for your email concerning Rcpp.<br>
<br>
Due to the number of emails I receive about Rcpp, I can no longer respond to each incoming email individually.  However, documentation is available via:<br>
<br>
  eight pdf "vignette" files which are included in the package, among them a<br>
  FAQ and an introduction to Rcpp<br>
<br>
  the introductory vignette is also published in the Journal of Statistical<br>
  Software (<a href="http://www.jstatsoft.org/v40/i08/" target="_blank">http://www.jstatsoft.org/v40/i08/</a>)<br>
<br>
  my book at Springer (see <a href="http://www.rcpp.org/book" target="_blank">http://www.rcpp.org/book</a>) released in June 2013<br>
<br>
  about 80 examples published in the Rcpp Gallery (<a href="http://gallery.rcpp.org" target="_blank">http://gallery.rcpp.org</a>)<br>
<br>
  numerous answers on the rcpp-devel mailing list<br>
  (<a href="http://lists.r-forge.r-project.org/mailman/listinfo/rcpp-devel" target="_blank">http://lists.r-forge.r-project.org/mailman/listinfo/rcpp-devel</a>) and you are<br>
  invited to ask on the list (but need to subscribe first)<br>
<br>
  numerous posts on the StackOverflow site under the 'rcpp' tag<br>
  (<a href="http://stackoverflow.com/questions/tagged/rcpp" target="_blank">http://stackoverflow.com/questions/tagged/rcpp</a>) and you are invited to ask<br>
  there as well (though the rcpp-devel list may still get better answers)<br>
<br>
  posts on my blog (<a href="http://dirk.eddelbuettel.com/blog" target="_blank">http://dirk.eddelbuettel.com/blog</a>)<br>
<br>
  the code archive itself at GitHub <a href="https://github.com/RcppCore/Rcpp" target="_blank">
https://github.com/RcppCore/Rcpp</a> and the<br>
  package itself on CRAN (<a href="http://cran.r-project.org/web/packages/Rcpp/index.html" target="_blank">http://cran.r-project.org/web/packages/Rcpp/index.html</a>),<br>
  in particular the unitTest examples can be instructive<br>
<br>
  the over 320 packages on CRAN (and 41 more on BioConductor) using Rcpp<br>
<br>
Additionally, the introductory vignettes for RcppArmadillo and RcppEigen have now been published as well (<a href="http://dx.doi.org/10.1016/j.csda.2013.02.005" target="_blank">http://dx.doi.org/10.1016/j.csda.2013.02.005</a>;<br>
<a href="http://www.jstatsoft.org/v52/i05/" target="_blank">http://www.jstatsoft.org/v52/i05/</a>)<br>
<br>
In particular, the  rcpp-devel  mailing list is the perfect place for questions (but please register in order to post, a measure required to keep spammers away).<br>
<br>
Sincerely,  Dirk Eddelbuettel<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel |
<a href="mailto:edd@debian.org">edd@debian.org</a><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><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>