Skip to content

Commit

Permalink
#138: Tighten up types
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilMiller committed Oct 26, 2020
1 parent f5d6c77 commit fe6baf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/checkpoint/dispatch/vrt/object_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct ObjectEntry {
std::size_t size_ = 0; /**< The registered object size */
std::function<void*(void)> allocator_; /**< Do standard allocation for object */
std::function<T*(void*)> constructor_; /**< Construct object on memory */
std::function<T*(void*)> caster_; /**< Try to dynamic_cast<ObjT> */
std::function<T*(T*)> caster_; /**< Try to dynamic_cast<ObjT> */
};

template <typename T>
Expand Down Expand Up @@ -115,7 +115,7 @@ Registrar<ObjT>::Registrar() {
sizeof(ObjT),
[]() -> void* { return std::allocator<ObjT>{}.allocate(1); },
[](void* buf) -> BaseType* { return dispatch::Reconstructor<ObjT>::constructAllowFail(buf); },
[](void* buf) -> ObjT* { return dynamic_cast<ObjT>(buf); }
[](BaseType* buf) -> ObjT* { return dynamic_cast<ObjT>(buf); }
}
);
}
Expand Down

0 comments on commit fe6baf8

Please sign in to comment.