back_insert_iterator.cc [plain text]
#include <iterator>
#include <list>
void test01()
{
using namespace std;
list<int> l;
typedef back_insert_iterator<list<int> > test_iterator;
typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
test_iterator r_it(l);
base_iterator* base __attribute__((unused)) = &r_it;
typedef test_iterator::value_type value_type;
typedef test_iterator::difference_type difference_type;
typedef test_iterator::pointer pointer;
typedef test_iterator::reference reference;
typedef test_iterator::iterator_category iteratory_category;
typedef test_iterator::container_type container_type;
}
template class std::back_insert_iterator<std::list<int> >;
void test02()
{
typedef std::back_insert_iterator<std::list<int> > iterator_type;
std::list<int> li;
iterator_type it = std::back_inserter(li);
}
class test_dm : public std::back_insert_iterator<std::list<int> >
{
container_type l;
container_type* p;
public:
test_dm(): std::back_insert_iterator<std::list<int> >(l), p(container) { }
};
#if !__GXX_WEAK__ && _MT_ALLOCATOR_H
template class __gnu_cxx::__mt_alloc<std::_List_node<int> >;
#endif
int main()
{
test01();
test02();
return 0;
}