r-lib / cpp11

cpp11 helps you to interact with R objects using C++ code.
https://cpp11.r-lib.org/
Other
193 stars 46 forks source link

FIX: list_of operator[] missing const modifiers. #303

Closed tcpan closed 1 year ago

tcpan commented 1 year ago

Read only version of list_of operator[] functions was missing const modifiers. As a result, when trying to access list elements, 1. const list_of ends up calling list's operator[] functions thus without auto type conversion, and 2 if forcing to use list_of::operator[], we encounter compiler error that the call "discards const-ness".

romainfrancois commented 1 year ago

Thanks.