Implemented smart pointer detection using templates