ostream operator for perm_string objects.
This commit is contained in:
parent
4d445dc269
commit
f4217af506
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
# include "StringHeap.h"
|
||||
# include <iostream>
|
||||
# include <cstdlib>
|
||||
# include <cstring>
|
||||
# include <cassert>
|
||||
|
|
@ -199,3 +200,12 @@ bool operator < (perm_string a, perm_string b)
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
ostream& operator << (ostream&out, perm_string that)
|
||||
{
|
||||
if (that.nil())
|
||||
out << "<nil>";
|
||||
else
|
||||
out << that.str();
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ extern bool operator > (perm_string a, perm_string b);
|
|||
extern bool operator < (perm_string a, perm_string b);
|
||||
extern bool operator >= (perm_string a, perm_string b);
|
||||
extern bool operator <= (perm_string a, perm_string b);
|
||||
extern ostream& operator << (ostream&out, perm_string that);
|
||||
|
||||
/*
|
||||
* The string heap is a way to permanently allocate strings
|
||||
|
|
|
|||
|
|
@ -53,12 +53,6 @@ ostream& operator << (ostream&o, const PDelays&d)
|
|||
return o;
|
||||
}
|
||||
|
||||
ostream& operator<< (ostream&out, perm_string that)
|
||||
{
|
||||
out << that.str();
|
||||
return out;
|
||||
}
|
||||
|
||||
ostream& operator<< (ostream&out, const index_component_t&that)
|
||||
{
|
||||
out << "[";
|
||||
|
|
|
|||
Loading…
Reference in New Issue