Skip to content

Write a utility function to make a shallow copy of an SGObject #5058

@gf712

Description

@gf712

Usually SGObjects are stored in shared_ptr, so when we perform a copy we just increment the control block refcount. We have a clone method to perform deep cloning, but this means we might be copying features, labels and weights, which is not always needed. This can be avoided by passing the respective ParameterProperties to the make_clone function, so it would be good to have make_shallow_copy free function that sets these flags automatically (something like ParameterProperties::ALL ^ ParameterProperties::MODEL ^ ParameterProperties::READONLY), and then just have something like make_shallow_copy(obj).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions