10000 cpp_wrapper `Aeron` should not move-from its l-value reference constructor parameter · Issue #1730 · aeron-io/aeron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
cpp_wrapper Aeron should not move-from its l-value reference constructor parameter #1730
Closed
@lukeocamden

Description

@lukeocamden

Hello, this tripped me up today. I wonder if it's not too late to fix.

Aeron's constructor has a parameter of type Context& and moves from it, which is pretty surprising. This code compiles and crashes:

aeron::Context context;
aeron::Aeron aeron(context);
context.cncFileName();

I think if the constructor is going to consume its parameter, I think the parameter should be of type Context or Context&& so that the above doesn't compile?

Let me know what you think!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0