1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-20 09:19:36 +01:00

* An forward non-random access input iterator class for ATermLists.

This commit is contained in:
Eelco Dolstra 2003-11-16 18:31:29 +00:00
parent 3e5a019a07
commit 45610ae675
6 changed files with 68 additions and 88 deletions

View file

@ -14,6 +14,28 @@ string atPrint(ATerm t);
/* Write an ATerm to an output stream. */
ostream & operator << (ostream & stream, ATerm e);
class ATermIterator
{
ATermList t;
public:
ATermIterator(ATermList _t) : t(_t) { }
ATermIterator & operator ++ ()
{
t = ATgetNext(t);
return *this;
}
ATerm operator * ()
{
return ATgetFirst(t);
}
operator bool ()
{
return t != ATempty;
}
};
/* Type-safe matching. */
struct ATMatcher