вот мой код
#pragma once
#include <vector>
#include <algorithm>
#include <cstddef>
#include <utility>

template <typename T>
class FlattenedVector {
    public:
        using iterator_category = std::random_access_iterator_tag;
        using value_type = T;
        using difference_type = std::ptrdiff_t;
        using pointer = T*;
        using reference = T&;

        std::pair<size_t, size_t> find_pos(size_t ind) const {
            auto it = std::upper_bound(prefixsum.begin(), prefixsum.end(), ind);
            size_t temp_idx = std::distance(prefixsum.begin(), it) - 1;
            size_t local_idx = ind - prefixsum[temp_idx];
            return {temp_idx, local_idx};
        }

        T& at(size_t ind) {
            auto [temp_idx, local_idx] = find_pos(ind);
            return const_cast<std::vector<T>&>((*data_)[temp_idx])[local_idx];
        }

        const T& at(size_t ind) const {
            auto [temp_idx, local_idx] = find_pos(ind);
            return (*data_)[temp_idx][local_idx];
        }

        class Iterator {
            public:
                using iterator_category = std::random_access_iterator_tag;
                using value_type = T;
                using difference_type = std::ptrdiff_t;
                using pointer = T*;
                using reference = T&;

                Iterator(const FlattenedVector<T>* parent, size_t ind)
                    : parent_(parent), ind_(ind) {}
                
                T& operator*() {
                    return parent_ -> at(ind_);
                }

                const T& operator*() const {
                    return parent_ -> at(ind_);
                }

                T* operator->() const {
                    return &parent_ -> at(ind_);
                }

                Iterator& operator++() {
                    ++ind_;
                    return *this;
                }

                Iterator operator++(int) {
                    Iterator temp = *this;
                    ++(*this);
                    return temp;;
                }

                Iterator& operator--() {
                    --ind_;
                    return *this;
                }

                Iterator operator--(int) {
                    Iterator temp = *this;
                    --(*this);
                    return temp;;
                }

                Iterator operator+(std::ptrdiff_t n) const {
                    return Iterator(parent_, ind_ + n);
                } 

                friend Iterator operator+(std::ptrdiff_t n, const Iterator& it) {
                    return it + n;
                }

                Iterator& operator+=(std::ptrdiff_t n) {
                    ind_ += n;
                    return *this;
                }

                Iterator operator-(std::ptrdiff_t n) const {
                    return Iterator(parent_, ind_ - n);
                }

                Iterator& operator-=(std::ptrdiff_t n) {
                    ind_ -= n;
                    return *this;
                }

                std::ptrdiff_t operator-(const Iterator& other) const {
                    return static_cast<std::ptrdiff_t>(ind_) - static_cast<std::ptrdiff_t>(other.ind_);
                }

                T& operator[](std::ptrdiff_t n) {
                    return parent_ -> at(ind_ + n);
                }

                const T& operator[](std::ptrdiff_t n) const {
                    return parent_ -> at(ind_ + n);
                }

                bool operator<(const Iterator& other) const {
                    return ind_ < other.ind_;
                }

                bool operator>(const Iterator& other) const {
                    return ind_ > other.ind_;
                }

                bool operator<=(const Iterator& other) const {
                    return ind_ <= other.ind_;
                }

                bool operator>=(const Iterator& other) const {
                    return ind_ >= other.ind_;
                }

                bool operator==(const Iterator& other) const {
                    return ind_ == other.ind_;
                }

                bool operator!=(const Iterator& other) const {
                    return ind_ != other.ind_;
                }
            
            private:
                FlattenedVector<T>* parent_;
                size_t ind_;
            
        };

        FlattenedVector(const std::vector<std::vector<T>>& data)
            : data_(&data) {
                prefixsum.reserve(data_ -> size() + 1);
                prefixsum.push_back(0);
                for (const auto& temp : *data_) {
                    prefixsum.push_back(prefixsum.back() + temp.size());
                }
            }
        
        Iterator begin() {
            return Iterator(this,0);
        }

        Iterator end() {
            return Iterator(this, size());
        }

        size_t size() {
            if (prefixsum.empty()){
                return 0;
            }
            else {
                return prefixsum.back();
            }
        }

        bool empty() {
            return size() == 0;
        }

        const T& operator[](size_t ind) const {
            return at(ind);
        }
        
        T& operator[](size_t ind) {
            return at(ind);
        }

    private:
        const std::vector<std::vector<T>>* data_;
        std::vector<size_t> prefixsum;
};

а вот каккие ошибки мне выдает проверяющая программа, можешь помочь исправить мой код, чтобы пофиксить эти ошибки
g++ -c -g -fsanitize=address -std=c++20 -Wall -Werror -I ../../contrib main.cpp -o main.o
main.cpp: In function 'void TestModify()':
main.cpp:203:13: error: assignment of read-only location 'it.FlattenedVector<char>::Iterator::operator*()'
  203 |         *it = new_value;
      |         ~~~~^~~~~~~~~~~
main.cpp:207:15: error: assignment of read-only location 'it.FlattenedVector<char>::Iterator::operator[](1)'
  207 |         it[1] = value;
In file included from main.cpp:1:
flatten.h: In instantiation of 'FlattenedVector<T>::Iterator::Iterator(const FlattenedVector<T>*, size_t) [with T = long int; size_t = long unsigned int]':
flatten.h:152:20:   required from 'FlattenedVector<T>::Iterator FlattenedVector<T>::begin() [with T = long int]'
main.cpp:79:54:   required from here
flatten.h:42:31: error: invalid conversion from 'const FlattenedVector<long int>*' to 'FlattenedVector<long int>*' [-fpermissive]
   42 |                     : parent_(parent), ind_(ind) {}
      |                               ^~~~~~
      |                               |
      |                               const FlattenedVector<long int>*
flatten.h: In instantiation of 'FlattenedVector<T>::Iterator::Iterator(const FlattenedVector<T>*, size_t) [with T = int; size_t = long unsigned int]':
flatten.h:152:20:   required from 'FlattenedVector<T>::Iterator FlattenedVector<T>::begin() [with T = int]'
main.cpp:90:9:   required from here
flatten.h:42:31: error: invalid conversion from 'const FlattenedVector<int>*' to 'FlattenedVector<int>*' [-fpermissive]
   42 |                     : parent_(parent), ind_(ind) {}
      |                               ^~~~~~
      |                               |
      |                               const FlattenedVector<int>*
flatten.h: In instantiation of 'FlattenedVector<T>::Iterator::Iterator(const FlattenedVector<T>*, size_t) [with T = {anonymous}::TestData; size_t = long unsigned int]':
flatten.h:152:20:   required from 'FlattenedVector<T>::Iterator FlattenedVector<T>::begin() [with T = {anonymous}::TestData]'
main.cpp:187:9:   required from here
flatten.h:42:31: error: invalid conversion from 'const FlattenedVector<{anonymous}::TestData>*' to 'FlattenedVector<{anonymous}::TestData>*' [-fpermissive]
   42 |                     : parent_(parent), ind_(ind) {}
      |                               ^~~~~~
      |                               |
      |                               const FlattenedVector<{anonymous}::TestData>*
flatten.h: In instantiation of 'FlattenedVector<T>::Iterator::Iterator(const FlattenedVector<T>*, size_t) [with T = char; size_t = long unsigned int]':
flatten.h:152:20:   required from 'FlattenedVector<T>::Iterator FlattenedVector<T>::begin() [with T = char]'
main.cpp:200:47:   required from here
flatten.h:42:31: error: invalid conversion from 'const FlattenedVector<char>*' to 'FlattenedVector<char>*' [-fpermissive]
   42 |                     : parent_(parent), ind_(ind) {}
      |                               ^~~~~~
      |                               |
      |                               const FlattenedVector<char>*
flatten.h: In instantiation of 'FlattenedVector<T>::Iterator::Iterator(const FlattenedVector<T>*, size_t) [with T = long unsigned int; size_t = long unsigned int]':
flatten.h:152:20:   required from 'FlattenedVector<T>::Iterator FlattenedVector<T>::begin() [with T = long unsigned int]'
main.cpp:231:54:   required from here
flatten.h:42:31: error: invalid conversion from 'const FlattenedVector<long unsigned int>*' to 'FlattenedVector<long unsigned int>*' [-fpermissive]
   42 |                     : parent_(parent), ind_(ind) {}
      |                               ^~~~~~
      |                               |
      |                               const FlattenedVector<long unsigned int>*