#include "universal_container/adaptive_sequence.hpp"

#include <cstdint>
#include <iostream>

int main() {
    uc::AdaptiveSequence<std::uint32_t, true> values;
    values.push_back(5);
    values.push_back(8);
    values.push_back(5);
    values.insert(1, 3);

    const auto id = values.id_at(2);
    values[2] = 13; // proxy updates the optional value index

    std::cout << "size=" << values.size()
              << " mode=" << (values.mode() == uc::StorageMode::vector ? "vector" : "tiered")
              << " contains(5)=" << values.contains(5)
              << " id(" << id << ") alive=" << values.id_alive(id)
              << '\n';

    values.force_tiered_mode();
    values.erase_by_id(id);
    values.enable_auto_mode();

    std::cout << "after tiered conversion and erase:";
    values.for_each([](std::uint32_t value) { std::cout << ' ' << value; });
    std::cout << '\n';
}

