#ifndef ROW_HPP
#define ROW_HPP

#include <iostream>
#include <cstdint>
#include <stdexcept>



template <typename T>
class Row { 
    private:
        T* p;
        uint32_t n;

    public:
        
        Row(uint32_t size = 0);

        
        Row(T* arr, uint32_t size);

        
        ~Row();

        
        Row(const Row &other);

        
        Row& operator=(const Row& other);

        
        T& operator[](uint32_t idx);
        const T& operator[](uint32_t idx) const;

        
        T& at(uint32_t idx);
        const T& at(uint32_t idx) const;

        
        uint32_t size() const;

        
        friend std::ostream& operator<<(std::ostream& os, const Row<T>& r) {
            for (uint32_t i = 0; i < r.n; i++) {
                os << r.p[i];
                if (i < r.n - 1) {
                    os << "  ";
                }
            }
            return os;
        }

        
        friend std::istream& operator>>(std::istream& is, Row<T>& r) {
            for (uint32_t i = 0; i < r.n; i++) {
                is >> r.p[i];
            }
            return is;
        }
};

#endif
