Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    6e5242f0
    DRTVWR-476: Fix LLError::Log::classname(T*) template function. · 6e5242f0
    Nat Goodspeed authored
    First, the signature classname(const T*) was wrong: that function could only
    accept a pointer to const T. The expression classname(someptr) where someptr
    was a pointer to non-const SomeType displayed "SomeType*" because it could
    only match classname(const T&), where T was SomeType*.
    
    classname(T* const) is what we should have written, meaning "const pointer to
    T" rather than "pointer to const T."
    
    Second, the previous implementation failed to handle the case in which the
    pointer was nullptr.
    6e5242f0
    History
    DRTVWR-476: Fix LLError::Log::classname(T*) template function.
    Nat Goodspeed authored
    First, the signature classname(const T*) was wrong: that function could only
    accept a pointer to const T. The expression classname(someptr) where someptr
    was a pointer to non-const SomeType displayed "SomeType*" because it could
    only match classname(const T&), where T was SomeType*.
    
    classname(T* const) is what we should have written, meaning "const pointer to
    T" rather than "pointer to const T."
    
    Second, the previous implementation failed to handle the case in which the
    pointer was nullptr.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.