Skip to content

Can't seem to overwrite elements of a writable list_of #131

Closed
@DavisVaughan

Description

@DavisVaughan
cpp11::cpp_source(
  code = '
  #include "cpp11/integers.hpp";
  #include "cpp11/list_of.hpp";
  
  [[cpp11::register]]
  cpp11::writable::list_of<cpp11::writable::integers> test() {
    cpp11::writable::integers x{1, 2};
    cpp11::writable::integers y{3, 4};
    cpp11::writable::list_of<cpp11::writable::integers> out({x});
    out[0] = y;
    return out;
  }
')

test()
#> [[1]]
#> [1] 1 2

Created on 2020-11-18 by the reprex package (v0.3.0.9001)

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