On Friday, 17 January 2014 at 14:06:59 UTC, Ola Fosheim Grøstad wrote:
Like if you delete a User object, then all "weak" pointers are set to a UnknownUser default object. So that you can call user.isLoggedIn() and get false, but you should be able to default to a different Class to get a different set of virtual calls.

This particular thing is easy enough to do with null too:

bool isLoggedIn(User user) {
    return user is null ? false : user.isLoggedInImpl();
}

Reply via email to