enum sign_type { positive, negative };
typedef typename std::vector< T > chunk_type;
typedef typename chunk_type::size_type size_type;
- typedef typename chunk_type::iterator iterator;
- typedef typename chunk_type::const_iterator const_iterator;
+ typedef typename chunk_type::iterator iterator;\r
+ typedef typename chunk_type::const_iterator const_iterator;\r
+ typedef typename chunk_type::reverse_iterator reverse_iterator;\r
+ typedef typename chunk_type::const_reverse_iterator const_reverse_iterator;
// Constructores (después de construído, el chunk siempre tiene al menos
// un elemento).
iterator begin() { return chunk.begin(); }
iterator end() { return chunk.end(); }
const_iterator begin() const { return chunk.begin(); }
- const_iterator end() const { return chunk.end(); }
+ const_iterator end() const { return chunk.end(); }\r
+ reverse_iterator rbegin() { return chunk.rbegin(); }\r
+ reverse_iterator rend() { return chunk.rend(); }\r
+ const_reverse_iterator rbegin() const { return chunk.rbegin(); }\r
+ const_reverse_iterator rend() const { return chunk.rend(); }\r
+
private:
// Atributos
template < typename T >
std::ostream& operator<< (std::ostream& os, const number< T >& n)
{
- // FIXME sacar una salida bonita en ASCII =)
- std::copy(n.begin(), n.end(), std::ostream_iterator< T >(os, " "));
+ // FIXME sacar una salida bonita en ASCII =)\r
+ std::copy(n.rbegin(), n.rend(), std::ostream_iterator< T >(os, " "));
return os;
}