# include <iostream>
#endif
-Unicode::Unicode(short c = 0): caracter(c) {
+Unicode::Unicode(short c): caracter(c) {
#ifdef DEBUG
std::cerr << "En constructor de Unicode." << std::endl;
#endif
return caracter == unicode.caracter;
}
-char Unicode::operator char(void) {
+Unicode::operator short(void) const {
+#ifdef DEBUG
+ std::cerr << "En cast de Unicode a char." << std::endl;
+#endif
+ return static_cast<short>(caracter);
+}
+
+Unicode::operator char(void) const {
#ifdef DEBUG
std::cerr << "En cast de Unicode a char." << std::endl;
#endif
return static_cast<char>(caracter);
}
-/// Volcado a un stream de salida.
std::ostream& operator<<(std::ostream& out, const Unicode& unicode) {
#ifdef DEBUG
std::cerr << "En operator<< de Unicode." << std::endl;
return out << unicode.caracter;
}
-/// Captura desde un stream de entrada.
std::istream& operator>>(std::istream& in, const Unicode& unicode) {
#ifdef DEBUG
std::cerr << "En operator>> de Unicode." << std::endl;