Skip to content

Commit

Permalink
male deserialize non-static and virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
riasc committed Oct 2, 2024
1 parent 0462643 commit 7062114
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/genogrove/AnyType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace genogrove {
virtual ~AnyBase() = default;
virtual std::type_index getDataTypeIndex() const = 0; // return type of stored data
virtual void serialize(std::ostream& os) const = 0;
static std::shared_ptr<AnyBase> deserialize(std::istream& is);
virtual std::shared_ptr<AnyBase> deserialize(std::istream& is) = 0;

};

Expand Down Expand Up @@ -50,7 +50,7 @@ namespace genogrove {
os.write(reinterpret_cast<const char*>(&data), sizeof(T));
}

static std::shared_ptr<AnyType> deserialize(std::istream& is) {
std::shared_ptr<AnyBase> deserialize(std::istream& is) {
size_t dataTypeNameLen;
is.read(reinterpret_cast<char*>(&dataTypeNameLen), sizeof(dataTypeNameLen));
std::string dataTypeName(dataTypeNameLen, '\0');
Expand Down

0 comments on commit 7062114

Please sign in to comment.