Skip to content

Commit 32eef66

Browse files
authored
FIX: list_of operator[] missing const modifiers. (#303)
1 parent b44343a commit 32eef66

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

inst/include/cpp11/list_of.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ class list_of : public list {
1313
list_of(const list& data) : list(data) {}
1414

1515
#ifdef LONG_VECTOR_SUPPORT
16-
T operator[](int pos) { return operator[](static_cast<R_xlen_t>(pos)); }
16+
T operator[](int pos) const { return operator[](static_cast<R_xlen_t>(pos)); }
1717
#endif
1818

19-
T operator[](R_xlen_t pos) { return list::operator[](pos); }
19+
T operator[](R_xlen_t pos) const { return list::operator[](pos); }
2020

21-
T operator[](const char* pos) { return list::operator[](pos); }
21+
T operator[](const char* pos) const { return list::operator[](pos); }
2222

23-
T operator[](const std::string& pos) { return list::operator[](pos.c_str()); }
23+
T operator[](const std::string& pos) const { return list::operator[](pos.c_str()); }
2424
};
2525

2626
namespace writable {

0 commit comments

Comments
 (0)