正在加载图片...
From pointers to iterators(cont,) u Request 4 Let the previous findo function also support the list container in sTl Our arithmetic of pointer in previous function wi not work, because the addressing is different Array and vector using consecutive memory block(++,-) List using linked memory units(->next, ->prev) a To solve it, we must add an abstract layer to encapsulate the low-level pointer actions, thus avoiding user's direct manipulating with low-level pointers Iterators- abstract pointers to containersFrom pointers to iterators (cont.) ◼ Request 4: ◼ Let the previous find() function also support the list container in STL ◼ Our arithmetic of pointer in previous function will not work, because the addressing is different ◼ Array and vector using consecutive memory block (++, --) ◼ List using linked memory units (->next, ->prev) ◼ To solve it, we must add an abstract layer to encapsulate the low-level pointer actions, thus avoiding user’s direct manipulating with low-level pointers ◼ Iterators – abstract pointers to containers
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有