⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tstiter.cpp

📁 SPLASH is a c++ class library that implements many of the Perl constructs and data types, including
💻 CPP
字号:
#include <fstream.h>
#include <stdlib.h>
#include <stdio.h>
#pragma hdrstop

#include "splash.h"
#include "splistit.h"

typedef int INT;

void test(const SPStringList& sl)
{
SPListIter<SPString> n(sl);
   for(n.reset(); n; ++n){
	cout << *n() << endl;
   }
  
}

void main()
{
SPList<INT> l;
SPStringList sl;
    
    for(int i=0;i<10;i++) l.push(i);
    sl.push("one"); sl.push("two");
    
    i= 0;
    for(SPListIter<INT> n(l); n; ++n){
	cout << *n() << " -- " << l[i++] << endl;
    }
  
    const int *ip;
    n.reset();
    while((ip = n++) != NULL){
        cout << *ip << endl;
    }
     
    FOREACH(int, t, l) cout << t << endl;
    ENDFOREACH

    SPString s;
    for(SPListIter<SPString> sn(sl); sn; sn++){
        cout << *sn() << ":" << s << endl;
    }

    test(sl);
}

#ifdef __GNUC__
template ostream& operator<<(ostream &, SPList<int> const &);
template ostream& operator<<(ostream &, SPList<SPString> const &);

template class SPList<int>;
template class SPList<SPString>;
template class SPList<Range>;
template class SPListBase<int>;
template class SPListBase<SPString>;
template class SPListBase<Range>;
template class SubList<int>;
template class SubList<SPString>;
template class SubList<Range>;

template class SPListIter<INT>;
template class SPListIter<SPString>;

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -