diff --git a/tesseract_command_language/include/tesseract_command_language/composite_instruction.h b/tesseract_command_language/include/tesseract_command_language/composite_instruction.h index 268a98d4a4..859d20beb0 100644 --- a/tesseract_command_language/include/tesseract_command_language/composite_instruction.h +++ b/tesseract_command_language/include/tesseract_command_language/composite_instruction.h @@ -71,8 +71,17 @@ class CompositeInstruction EIGEN_MAKE_ALIGNED_OPERATOR_NEW // LCOV_EXCL_STOP - /** User Data */ - using UserDataVariant = std::variant; + /** + * @brief Alias for a variant that can hold various types of data. + * @details The first type of the variant is std::monostate in order to prevent + * default-constructed variants from holding a type (a default-constructed + * variant is returned when a user calls CompositeInstruction::UserData with a key that + * doesn't exist for the CompositeInstruction. In this case, since the key doesn't + * exist, the variant that is returned shouldn't hold any types - an + * "empty variant" should be returned for keys that don't exist) + */ + using UserDataVariant = + std::variant; using UserData = std::unordered_map; /** value_type */