Cloces #2 use links instead of value

This commit is contained in:
DH
2026-02-27 19:02:30 -05:00
parent f1139c582a
commit 9f84ab13db

View File

@@ -75,7 +75,7 @@ class TypeFsactory {
* @endcode * @endcode
*/ */
template<class Derived> template<class Derived>
void registerType (ClassId_T id) { void registerType (const ClassId_T& id) {
/// store pointer to constructor of Derived class /// store pointer to constructor of Derived class
classes[id] = &typefactory<Derived>; classes[id] = &typefactory<Derived>;
} }
@@ -86,7 +86,7 @@ class TypeFsactory {
* @return shared pointer to new class. * @return shared pointer to new class.
* @throws std::our_of_range when id not found in map * @throws std::our_of_range when id not found in map
*/ */
typefactoryFunction create (ClassId_T id) const { typefactoryFunction create (const ClassId_T& id) const {
/// constructor of registered type will call here /// constructor of registered type will call here
return classes.at (id); return classes.at (id);
} }