added shared_ptr support to constList() and nonConstList()