/////////////////////////////////////////////////////////////////////
+ template <typename _ValueTypeRef, typename _Iterator>
+ class _attach_iterator_base : public virtual _iterator_base<_ValueTypeRef>//, public virtual _Iterator
+ {
+ protected:
+ _Iterator *m_pimpl;
+ public:
+ _attach_iterator_base(_Iterator* pimpl) : m_pimpl(pimpl){}
+
+ // Next (Like iterator ++)
+ void next(){ m_pimpl->next(); }
+
+ // Iterator pointer iValid?
+ bool is_valid(){ return m_pimpl->is_valid(); }
+
+ // Value
+ _ValueTypeRef get_value_ref(){ return m_pimpl->get_value_ref(); }
+ };
+
+ template <typename _ValueTypeRef, typename _Iterator>
+ class _attach_iterator_base_release : public virtual _iterator_base<_ValueTypeRef>//, public virtual _Iterator
+ {
+ protected:
+ _Iterator *m_pimpl;
+ public:
+ _attach_iterator_base_release(_Iterator* pimpl) : m_pimpl(pimpl){}
+ virtual ~_attach_iterator_base_release() { delete pimpl; }
+
+ // Next (Like iterator ++)
+ void next(){ m_pimpl->next(); }
+
+ // Iterator pointer iValid?
+ bool is_valid(){ return m_pimpl->is_valid(); }
+
+ // Value
+ _ValueTypeRef get_value_ref(){ return m_pimpl->get_value_ref(); }
+ };
+
+ /////////////////////////////////////////////////////////////////////
+
template <typename _ValueTypeRef>
class _any_iterator_impl
{
: _Base(_Impl(pimpl)) {}
};
+ // Alias
template <typename _ValueTypeRef>
class _iterator :
public _iterator_adapter< _any_iterator_impl<_ValueTypeRef> >
////////////////////////////////////////////////////////////////////////
template <typename T>
- _iterator<void> get_iterator(void*)
- {
- return _iterator<void>(NULL);
- }
-
- /////////////////
-
- template <typename T>
- _iterator<T> get_iterator< ::std::vector<T> >( ::std::vector<T>& ary )
+ _iterator<T> get_iterator( ::std::vector<T>& ary )
{
- m_ary = ary;
+ return _attach_iterator_base_release<T,
+ _stllike_uni_iterator_to_roast_impl< ::std::vector<T> >
+ >( new _stllike_uni_iterator_to_roast_impl< ::std::vector<T> >(ary) );
}
////////////////////////////////////////////////////////////////////////