C++/reflection: Add null_reflection_p
Introduces a null_reflection_p function to check for null reflection objects, improving code readability.
This commit introduces the null_reflection_p function to check for null reflection objects in the C++ reflection implementation. This function provides a more concise and readable way to perform this check, improving code maintainability. The new function is used in splice and dump_expr to simplify the code.
In Details
The commit adds null_reflection_p to reflect.cc and cp-tree.h to provide a dedicated function for checking null reflection objects. This function is then used in splice and dump_expr within the C++ reflection implementation to improve code clarity and reduce redundancy.
For Context
C++ reflection allows programs to examine types and their members at runtime. A null reflection object represents the absence of a valid reflection. This commit provides a utility function to test for this condition, improving the readability and maintainability of code that uses C++ reflection.