Blender Git Commit Log
Git Commits -> Revision a04a39b
Revision a04a39b by Lukas Toenne (depsgraph_refactor) May 12, 2014, 17:52 (GMT) |
Added upcast functions for safely converting a generic ID pointer into one of the DNA structs. This uses the GS macro to compare an ID block's prefix to the associated DNA struct. The static_cast_id variant only does contains an assert, while the dynamic_cast_id variant safely checks and returns a NULL pointer in case the ID type doesn't match. A new utility header for type traits has been added. These are standard techniques used in boost and C++11, but added as own implementation here to avoid nasty dependencies. |
Commit Details:
Full Hash: a04a39bcc9228298629ac9f9fb07b0a05426790f
Parent Commit: 7b9a14d
Lines Changed: +139, -0
1 Added Path:
/source/blender/depsgraph/util/depsgraph_util_type_traits.h (+38, -0) (View)