8000 ptr_to() is less flexible than shared_ptr style aliased constructors. · Issue #18 · hsutter/gcpp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
ptr_to() is less flexible than shared_ptr style aliased constructors. #18
Open
@ahmedcharles

Description

@ahmedcharles

If I have the following code:

#include <memory>
#include <vector>

struct S {
  std::vector<int> v;
};

int main() {
  auto p = std::make_shared<S>();
  p->v.push_back(1);
  auto a = std::shared_ptr<int>(p, &p->v[0]);
}

It's valid and works with shared_ptr, but is currently not allowed by ptr_to. I.e. they do not expose equivalent functionality.

link to ptr_to: https://github.com/hsutter/gcpp/blob/master/deferred_heap.h#L487

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0