🎇 cib::service
pointers should be constinit
initialized to a default function pointer or type
#665
Labels
enhancement
New feature or request
There are some unfortunate cases in which a
cib::service
pointer may not be initialized. If it is later used, UB is invoked and it becomes very difficult for a library user to understand what is going on. This happens ifnexus.init()
is never called, or if a non-existent service is called throughcib::service
.We can't check this at compile-time, but we can ensure that each
cib::service
pointer dereferenced isconstinit
initialized to a default implementation that logs an error when called. For the flow library, this would simply be a function pointer that logs an error saying the given flow was never added to the nexus.The text was updated successfully, but these errors were encountered: