X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/blobdiff_plain/38146f219b98da8c9de845337b83a0bf8716c83d..586ad2d03cf73d7e75a1a2522db3e0c4eedd5e9c:/trunk/src/indicemagico.h?ds=sidebyside diff --git a/trunk/src/indicemagico.h b/trunk/src/indicemagico.h index e52b220..a23c975 100644 --- a/trunk/src/indicemagico.h +++ b/trunk/src/indicemagico.h @@ -9,7 +9,7 @@ #include #include -#include +#include template @@ -112,6 +112,24 @@ public: }; - +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; +} + +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; +} #endif