From 02829c0a943fc03f7b6c85d18d2d210395f05086 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 16 Dec 2006 16:49:10 +0000 Subject: [PATCH] =?utf8?q?Mejora=20debug=20para=20IndiceMagico=20(agregand?= =?utf8?q?o=20especializaci=C3=B3n=20de=20template=20para=20punteros).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- trunk/src/indicemagico.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/trunk/src/indicemagico.h b/trunk/src/indicemagico.h index adbc0cc..a23c975 100644 --- a/trunk/src/indicemagico.h +++ b/trunk/src/indicemagico.h @@ -115,8 +115,20 @@ public: template < typename T > std::ostream& operator<< (std::ostream& os, CIndiceMagico& im) { - for (unsigned i = 0; i < im.count(); ++i) - os << "\t" << im.keys(i) << "=" << im[i] << "\n"; + unsigned c = im.count(); + if (c == 0) return os << "\t\tvacío\n"; + for (unsigned i = 0; i < c; ++i) + os << "\t\t" << im.keys(i) << ":\t" << im[i] << "\n"; + return os; +} + +template < typename T > +std::ostream& operator<< (std::ostream& os, CIndiceMagico& im) +{ + unsigned c = im.count(); + if (c == 0) return os << "\t\tvacío\n"; + for (unsigned i = 0; i < c; ++i) + os << "\t\t" << im.keys(i) << ":\t" << *im[i] << "\n"; return os; } -- 2.43.0