Skip to content

Commit a993262

Browse files
committed
Use const_NameProxy in Vector
1 parent f3c2f92 commit a993262

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

inst/include/Rcpp/vector/Vector.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ class Vector :
135135
inline NameProxy at( const std::string& name ){
136136
return NameProxy( *this, name ) ;
137137
}
138-
inline NameProxy at( const std::string& name ) const {
139-
return NameProxy( *this, name ) ;
138+
inline const_NameProxy at( const std::string& name ) const {
139+
return const_NameProxy( *this, name ) ;
140140
}
141-
inline NameProxy operator[]( const std::string& name ) const {
142-
return NameProxy( const_cast<Vector&>(*this), name ) ;
141+
inline const_NameProxy operator[]( const std::string& name ) const {
142+
return const_NameProxy( *this, name ) ;
143143
}
144144

145145
Vector& sort(){

0 commit comments

Comments
 (0)