<div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">Sorry, </span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">I am new to this list, </span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">I sent again the mail to you rather to the mailing list. </span></div>
<div><font face="arial, sans-serif">I prefer to ask my question in SO but I don't want to to bother others with too specific rcpp questions.</font></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">My bad. I did that (std::) but  I had to fix the the warning before.</span><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
<div>I am developing a package so I add </div><div><br></div><div>PKG_CXXFLAGS = "-std=c++0x"</div><div><br></div><div>to both : makevars and makevars.win. </div><div><br></div><div>Thanks.</div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Dec 22, 2013 at 4:48 PM, contact AG STUDY <span dir="ltr"><<a href="mailto:contact@ag-study.com" target="_blank">contact@ag-study.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">My bad. I did that (std::) but  I had to fix the the warning before.<div><div>I am developing a package so I add </div><div><br></div><div>PKG_CXXFLAGS = "-std=c++0x"</div><div><br></div><div>to both : makevars and makevars.win. </div>

<div><br></div><div>Thanks.</div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Dec 22, 2013 at 3:31 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Please keep follow-up questions on the list where I am replying to now.<br>
<div><br>
On 22 December 2013 at 15:20, contact AG STUDY wrote:<br>
| Impressive!Thanks for this fast answer.<br>
|<br>
| |  error: no matching function for call to 'remove_if(std::vector<br>
| | <std::basic_string<char> >::iterator, std::vector<std::basic_string<char><br>
| | >::iterator, stripWords(std::vector<std::basic_string<char> >&, std::set<br>
| | <std::basic_string<char> >&)::<lambda(const string&)>)'<br>
|<br>
| You said : Try prefixing it with  std::  as you did with the things from the<br>
| std<br>
| namespace.<br>
|<br>
| I am afraid to say , I don't understand what do you mean here? How can I fix<br>
| it?<br>
<br>
</div>Instead of calling<br>
<br>
        remove_if( ... many arguments ... )<br>
<br>
call<br>
<br>
        std::remove_if( ... many arguments ... )<br>
<span><font color="#888888"><br>
Dirk<br>
</font></span><div><div><br>
<br>
| On Sun, Dec 22, 2013 at 3:14 PM, Dirk Eddelbuettel <<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>> wrote:<br>
|<br>
|<br>
|     On 22 December 2013 at 14:46, contact AG STUDY wrote:<br>
|     | I am trying to write an efficient c++ function to remove some words from<br>
|     a big<br>
|     | vector of strings.<br>
|     | Here my code using stl :<br>
|     |<br>
|     | vector<std::string> stripWords(vector<std::string>& input, <br>
|     |                   std::set<std::string>& toRemove){ <br>
|     | input.erase(<br>
|     |      remove_if(input.begin(), input.end(), <br>
|     |                  [&toRemove](const std::string& x) -> bool {<br>
|     |                      return toRemove.find(x) != toRemove.end<br>
|     ();<br>
|     |                  }),input.end());<br>
|     | }<br>
|     |<br>
|     | But I get this warning about using lambda expression and this template<br>
|     error.<br>
|     |<br>
|     |<br>
|     |  warning: lambda expressions only available with -std=c++0x or -std=<br>
|     gnu++0x<br>
|     | [enabled by default]<br>
|<br>
|     R is (by default) not configured to use C++11. We are slowly moving towards<br>
|     getting that changed (ie see NEWS in the R-devel sources).<br>
|<br>
|     For the time being you can either<br>
|<br>
|      i)   for all R sessions, set the required option as an argument to<br>
|     CXXFLAGS in<br>
|           ~/.R/Makevars, or its system-wide equivalent, or another script<br>
|     where<br>
|           you set environment variables<br>
|<br>
|      ii)  if you use Rcpp Attributes, use `[[Rcpp::plugins(cpp11)]]` and see<br>
|           `help(pluginsAttribute)`  for details<br>
|<br>
|      iii) for a package use src/Makevars or src/Makevars.win<br>
|<br>
|     |  error: no matching function for call to 'remove_if(std::vector<br>
|     | <std::basic_string<char> >::iterator, std::vector<std::basic_string<char><br>
|     | >::iterator, stripWords(std::vector<std::basic_string<char> >&, std::set<br>
|     | <std::basic_string<char> >&)::<lambda(const string&)>)'<br>
|<br>
|     Try prefixing it with  std::  as you did with the things from the std<br>
|     namespace.<br>
|<br>
|     Dirk<br>
|<br>
|     --<br>
|     Dirk Eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
|<br>
|<br>
<br>
--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>