[[Rcpp::export]]
| 498 | |
| 499 | // [[Rcpp::export]] |
| 500 | CharacterVector character_matrix_row_iteration_decr( CharacterMatrix m ){ |
| 501 | std::string pasted_row; |
| 502 | CharacterMatrix::Row row(m(1, _)); |
| 503 | CharacterMatrix::Row::iterator i_row(row.end()); |
| 504 | i_row--; // Step back from 'one past the end' to 'last element'. |
| 505 | // Only copy the last three elements, to avoid creating an invalid |
| 506 | // 'one before the beginning' iterator: |
| 507 | for( size_t i=0 ; i<3; i++){ |
| 508 | pasted_row += *i_row--; |
| 509 | } |
| 510 | return wrap( pasted_row ) ; |
| 511 | } |
| 512 | |
| 513 | |
| 514 | // [[Rcpp::export]] |