trick to make range object testable, if (x)
iterator for erase needs to be non-const
use accessors for pointer tests
use new direct test of valid for range object