X-Git-Url: https://git.llucax.com/z.facultad/75.42/string.git/blobdiff_plain/91ae14ba4499be590813ab84a75f5c027ac12c11..18dabcacb51313294c968b9a9217674666b4bbf9:/ascii.cpp diff --git a/ascii.cpp b/ascii.cpp index f4b72d8..9a0982c 100644 --- a/ascii.cpp +++ b/ascii.cpp @@ -20,7 +20,7 @@ # include #endif -Ascii::Ascii(char c = '0'): caracter(c) { +Ascii::Ascii(char c): caracter(c) { #ifdef DEBUG std::cerr << "En constructor de Ascii." << std::endl; #endif @@ -60,7 +60,14 @@ bool Ascii::operator==(const Ascii& ascii) { return caracter == ascii.caracter; } -short Ascii::operator short(void) { +Ascii::operator char(void) const { +#ifdef DEBUG + std::cerr << "En cast de Ascii a char." << std::endl; +#endif + return static_cast(caracter); +} + +Ascii::operator short(void) const { #ifdef DEBUG std::cerr << "En cast de Ascii a short." << std::endl; #endif