[Rd] PROTECT SEXP in stl map

From: finle014 <finle014_at_umn.edu>
Date: Fri 30 Dec 2005 - 16:59:31 GMT

Hello All,

Im sure this question is basic but Im just getting started with R/c++ calls.

I would like to use an standard template library (STL) map to organize some SEXP types in my program. The map is map<int, SEXP> paramMap. To insert values into the value portion of this map I make a call to the function getListElement (as defined on page 52 in Writing R Extensions). So the insert looks like:

paramMap.insert(pair<int,SEXP>( some int, getListElement( some args )));

This statement is set in a for loop so that several map elements are inserted. On insert the return from getListElement is copied.

My question is, do I need to somehow PROTECT the SEXP value portion of this map? Or this this not necessary?


R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Dec 31 04:08:17 2005

This archive was generated by hypermail 2.1.8 : Sat 31 Dec 2005 - 05:23:53 GMT