[Rcpp-devel] IntegerVector initialization

Dirk Eddelbuettel edd at debian.org
Thu Jan 12 22:16:19 CET 2012


On 12 January 2012 at 11:29, Gregor Kastner wrote:
| This is a minor thing but caused some confusion to me:
| 
| IntegerVector foo1(2, 4.0);  // works
| IntegerVector foo2(2, 4);    // throws error

What were you expecting with the second argument?  A 'fill' value?  Arguably,
int should then work.
 
| while
| 
| IntegerVector bar1 = IntegerVector::create(4.0, 4.0);  // works
| IntegerVector bar2 = IntegerVector::create(4, 4);      // works

::create is very different from the constructors above.
 
| Bug or feature?

Depends. What were you trying to do?

Dirk

-- 
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
dark to read." -- Groucho Marx


More information about the Rcpp-devel mailing list