From finle014 at umn.edu  Fri Dec 30 17:59:31 2005
From: finle014 at umn.edu (finle014)
Date: Fri, 30 Dec 2005 10:59:31 CST
Subject: [Rd] PROTECT SEXP in stl map
Message-ID: <200512301659.jBUGxV67032352@sarge.software.umn.edu>

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?

Thanks-
Andy



[Rd] PROTECT SEXP in stl map
finle014