Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions include/vsg/core/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,15 @@ namespace vsg
return new_object.template cast<T>();
}

/// clone a named meta data object stored within an object's Auxliary object if available, others default construct object
template<class T, class C>
ref_ptr<T> clone(const std::string& key, C container)
{
if (container)
{
if (auto prototype = container->template getRefObject<T>(key)) return vsg::clone(prototype);
}
return T::create();
}

} // namespace vsg
Loading