MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / copy

Method copy

src/sys/options.cxx:49–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47void Options::cleanup() { root() = Options{}; }
48
49Options Options::copy() const {
50 Options result;
51
52 result.value = value;
53 result.attributes = attributes;
54 result.parent_instance = parent_instance;
55 result.full_name = full_name;
56 result.is_section = is_section;
57 result.value_used = value_used;
58
59 // Recursively copy children
60 for (const auto& child_it : children) {
61 auto pair_it = result.children.emplace(child_it.first, child_it.second.copy());
62 Options& child = pair_it.first->second;
63 child.parent_instance = &result;
64 }
65 return result;
66}
67
68Options::Options(Options&& other) noexcept
69 : value(std::move(other.value)), attributes(std::move(other.attributes)),

Callers 4

getUnusedMethod · 0.95
cyclone.pyFile · 0.80
OptionsMethod · 0.80
TEST_FFunction · 0.80

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.64