mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-09 21:24:14 +00:00
ContainerInfo: Create explicit clone method to copy objects
This commit is contained in:
parent
7361d8fa29
commit
4e80dace1a
@ -71,12 +71,15 @@ struct ContainerInfo {
|
||||
codegen(std::move(codegen_)) {
|
||||
}
|
||||
|
||||
ContainerInfo(const ContainerInfo&) = delete;
|
||||
ContainerInfo& operator=(const ContainerInfo& other) = delete;
|
||||
|
||||
ContainerInfo(ContainerInfo&&) = default;
|
||||
ContainerInfo& operator=(ContainerInfo&&) = default;
|
||||
|
||||
// Explicit interface for copying
|
||||
ContainerInfo clone() const {
|
||||
ContainerInfo copy{*this};
|
||||
return copy;
|
||||
}
|
||||
|
||||
std::string typeName;
|
||||
std::regex matcher;
|
||||
std::optional<size_t> numTemplateParams;
|
||||
@ -89,6 +92,7 @@ struct ContainerInfo {
|
||||
// adapter
|
||||
std::optional<size_t> underlyingContainerIndex{};
|
||||
std::vector<size_t> stubTemplateParams{};
|
||||
bool captureKeys = false;
|
||||
|
||||
Codegen codegen;
|
||||
|
||||
@ -98,6 +102,10 @@ struct ContainerInfo {
|
||||
bool operator<(const ContainerInfo& rhs) const {
|
||||
return (typeName < rhs.typeName);
|
||||
}
|
||||
|
||||
private:
|
||||
ContainerInfo(const ContainerInfo&) = default;
|
||||
ContainerInfo& operator=(const ContainerInfo& other) = default;
|
||||
};
|
||||
|
||||
class ContainerInfoError : public std::runtime_error {
|
||||
|
Loading…
Reference in New Issue
Block a user