Skip to content

r_vector::const_iterator::operator* is not const #113

Closed
@bkietz

Description

@bkietz

This means cpp11::r_vector can break otherwise valid generic code, since LegacyInputIterator is required to be const dereferencable.

cpp_function('void fail(cpp11::integers ints) {
  const auto it = ints.begin();
  *it;
}', quiet = FALSE)
#> error: passing 'const cpp11::r_vector<int>::const_iterator' as 'this' argument discards qualifiers [-fpermissive]
#>     return *it;
#>             ^~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions