Skip to content

Commit 3c68423

Browse files
committed
more informative erro message
1 parent 2347130 commit 3c68423

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/behaviortree_cpp/bt_factory.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ class BehaviorTreeFactory
371371
template <typename T, typename... ExtraArgs>
372372
void registerNodeType(const std::string& ID, ExtraArgs... args)
373373
{
374+
// check first if the given class is abstract
375+
static_assert(!std::is_abstract_v<T>, "The given type can't be abstract");
376+
374377
constexpr bool param_constructable =
375378
std::is_constructible<T, const std::string&, const NodeConfig&, ExtraArgs...>::value;
376379
constexpr bool has_static_ports_list = has_static_method_providedPorts<T>::value;

0 commit comments

Comments
 (0)