30 bool equals(
const __A__&
object)
const
32 return this->value ==
object.value;
35 friend std::istream&
operator>>(std::istream& in, __A__&
object)
37 return in >>
object.value;
40 friend std::ostream&
operator<<(std::ostream& out,
const __A__&
object)
42 return out <<
object.value;
59 bool equals(
const __B__&
object)
const
61 return this->value ==
object.value;
64 friend std::istream&
operator>>(std::istream& in, __B__&
object)
66 return in >>
object.value;
69 friend std::ostream&
operator<<(std::ostream& out,
const __B__&
object)
71 return out <<
object.value;
89 bool equals(
const __C__&
object)
const
91 return this->value ==
object.value;
94 friend std::istream&
operator>>(std::istream& in, __C__&
object)
96 return in >>
object.value;
99 friend std::ostream&
operator<<(std::ostream& out,
const __C__&
object)
101 return out <<
object.value;
114 public JMultiEquals<__D__, JTYPELIST<__A__, __B__, __C__>::typelist>,
115 public JTemplateReader<std::istream, __D__, JTYPELIST<__A__, __B__, __C__>::typelist>,
116 public JTemplateWriter<std::ostream, __D__, JTYPELIST<__A__, __B__, __C__>::typelist>
140 int main(
int argc,
char **argv)
148 JParser<> zap(
"Example program to test template I/O.");
154 catch(
const exception &error) {
155 FATAL(error.what() << endl);
160 const __D__ a(1,2,3);
171 DEBUG(
"a = " << a << endl);
172 DEBUG(
"b = " << b << endl);
183 for (
int value, i = 0; io >> value; ++i) {
185 const int c = io.get();
187 ASSERT((i < 2 && c == (
int)
'|') ||
188 (i == 2 && c == EOF));