Skip to content

SubsetProxy should validate input vector sizes #431

@kevinushey

Description

@kevinushey

Currently, the get_indices() functions (which are called in the constructor) do not validate the input sizes We should validate early that the right-hand side vector is either length 1, or same length as the left-hand side vector.

https://github.com/RcppCore/Rcpp/blob/master/inst/include/Rcpp/vector/Subsetter.h#L40

Note that we do perform this check when actually performing the subset (e.g. https://github.com/RcppCore/Rcpp/blob/master/inst/include/Rcpp/vector/Subsetter.h#L56-L66) but I think this is happening too late (we should validate before we do any work)

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