happly
happly copied to clipboard
Explicitly unwrap unique_ptrs in dynamic_casts
This change explicitly calls get() on unique_ptrs when they are used in a dynamic_cast. This must be the intended behavior, because the target type of the casts is a regular pointer and not a smart pointer, but I am not sure by which C++ mechanism this is currently achieved (i.e. unique_ptr should not be implicitly convertible to a regular pointer and the documentation for dynamic_cast does not mention smart pointers at all).
get() is safe to call on empty unique_ptrs, in which case it returns nullptr. Please also refer to line 821 where it is already called explicitly.
This fixes the compilation errors mentioned in #30 and the code now compiles using nvcc (tested with version 11.1).