[Rcpp-commits] r2265 - papers/rjournal

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Oct 2 16:47:03 CEST 2010


Author: edd
Date: 2010-10-02 16:47:02 +0200 (Sat, 02 Oct 2010)
New Revision: 2265

Modified:
   papers/rjournal/EddelbuettelFrancois.tex
Log:
add missing curly braces to example
minor whitespace juggling


Modified: papers/rjournal/EddelbuettelFrancois.tex
===================================================================
--- papers/rjournal/EddelbuettelFrancois.tex	2010-10-02 14:44:48 UTC (rev 2264)
+++ papers/rjournal/EddelbuettelFrancois.tex	2010-10-02 14:47:02 UTC (rev 2265)
@@ -363,18 +363,18 @@
 composition:
 
 \begin{example}
-SEXP someFunction() {
-  std::vector< std::map<std::string,int> > v;
-  std::map< std::string, int > m1;
-  std::map< std::string, int > m2;
+RcppExport SEXP someFunction() \{
+  std::vector<std::map<std::string,int> > v;
+  std::map<std::string, int> m1;
+  std::map<std::string, int> m2;
 
-  m1["foo"] = 1; m1["bar"] = 2;
-  m2["foo"] = 1; m2["bar"] = 2; m2["baz"] = 3;
+  m1["foo"]=1; m1["bar"]=2;
+  m2["foo"]=1; m2["bar"]=2; m2["baz"]=3;
 
-  v.push_back( m1);
-  v.push_back( m2);
+  v.push_back( m1 );
+  v.push_back( m2 );
   Rcpp::wrap( v );
-}
+\}
 \end{example}
 
 The code creates a list of two named vectors, equal to the 



More information about the Rcpp-commits mailing list