Skip to content

Commit d68aa72

Browse files
committed
merge Dirk's Rcpp changes; also add missing "return *this" in RObject_impl::operator=
2 parents 105f0fc + 1d6620e commit d68aa72

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2013-12-20 Kevin Ushey <kevinushey@gmail.com>
2+
3+
* inst/include/Rcpp/RObject.h: Add missing *this return for
4+
RObject_impl::operator=
5+
6+
2013-12-20 Dirk Eddelbuettel <edd@debian.org>
7+
8+
* inst/include/Rcpp/RObject.h: Applied fix by Kevin Ushey (#88)
9+
* inst/include/Rcpp/vector/Vector.h: Ditto (#89)
10+
111
2013-12-01 Kevin Ushey <kevinushey@gmail.com>
212

313
* R/Rcpp.package.skeleton.R: Fixed bug relating to user-supplied

inst/NEWS.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
\item The internal coercion mechanism mapping numerics to strings has
2020
been updated to better match \R (specifically with \code{Inf}, \code{-Inf},
2121
and \code{NaN}.)
22+
\item Applied two bug fixes to Vector \code{sort()} and \code{RObject}
23+
definition spotted and correct by Kevin Ushey
2224
}
2325
\item Changes in Rcpp documentation:
2426
\itemize{

inst/include/Rcpp/RObject.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Rcpp{
3030
/**
3131
* default constructor. uses R_NilValue
3232
*/
33-
RObject_Impl() ;
33+
RObject_Impl() {};
3434

3535
RCPP_GENERATE_CTOR_ASSIGN(RObject_Impl)
3636

@@ -47,7 +47,8 @@ namespace Rcpp{
4747
* Assignement operator. Set this SEXP to the given SEXP
4848
*/
4949
RObject_Impl& operator=( SEXP other ){
50-
Storage::set__(other) ;
50+
Storage::set__(other) ;
51+
return *this;
5152
}
5253

5354
void update(SEXP){}

inst/include/Rcpp/vector/Vector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class Vector :
239239
}
240240

241241
Vector& sort(){
242-
typename traits::storage_type<RTYPE>* start = internal::r_vector_start<RTYPE>( Storage::get__() ) ;
242+
typename traits::storage_type<RTYPE>::type* start = internal::r_vector_start<RTYPE>( Storage::get__() ) ;
243243
std::sort(
244244
start, start + size(),
245245
typename traits::comparator_type<RTYPE>::type()

0 commit comments

Comments
 (0)