From 9f84ab13db80b781970e134dbc2732c760cba684 Mon Sep 17 00:00:00 2001 From: DH Date: Fri, 27 Feb 2026 19:02:30 -0500 Subject: [PATCH] Cloces #2 use links instead of value --- typefactory/typefactory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typefactory/typefactory.h b/typefactory/typefactory.h index 7696432..6f84810 100644 --- a/typefactory/typefactory.h +++ b/typefactory/typefactory.h @@ -75,7 +75,7 @@ class TypeFsactory { * @endcode */ template - void registerType (ClassId_T id) { + void registerType (const ClassId_T& id) { /// store pointer to constructor of Derived class classes[id] = &typefactory; } @@ -86,7 +86,7 @@ class TypeFsactory { * @return shared pointer to new class. * @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 return classes.at (id); }