{"id":26780028,"url":"https://github.com/therealdevdan/customvector","last_synced_at":"2025-07-08T04:34:24.973Z","repository":{"id":274753195,"uuid":"923957094","full_name":"therealdevdan/CustomVector","owner":"therealdevdan","description":"Smart pointer based dynamic array in C++","archived":false,"fork":false,"pushed_at":"2025-01-29T08:04:23.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T06:45:04.385Z","etag":null,"topics":["cpp","dynamic-vector","oop-in-cpp","programmer","vector"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/therealdevdan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-29T06:20:14.000Z","updated_at":"2025-03-21T04:25:01.000Z","dependencies_parsed_at":"2025-03-20T16:54:31.595Z","dependency_job_id":null,"html_url":"https://github.com/therealdevdan/CustomVector","commit_stats":null,"previous_names":["alexandervondaniels1508/customvector","therealdevdan/customvector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealdevdan%2FCustomVector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealdevdan%2FCustomVector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealdevdan%2FCustomVector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealdevdan%2FCustomVector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/therealdevdan","download_url":"https://codeload.github.com/therealdevdan/CustomVector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246150412,"owners_count":20731419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","dynamic-vector","oop-in-cpp","programmer","vector"],"created_at":"2025-03-29T06:45:15.534Z","updated_at":"2025-03-29T06:45:16.209Z","avatar_url":"https://github.com/therealdevdan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CustomVector\nA C++ implementation of a dynamic array (vector).\n\n\n# Dynamic Array Implementation in C++\n\nThis repository contains a C++ implementation of a dynamic array (vector) that supports various common operations.\n\n## Features\n\nThis dynamic array implementation provides the following features:\n\n### Constructors\n\n*   **`Vector()`**: Default constructor that creates a vector with an initial capacity of 8.\n*   **`Vector(T* _data, size_t len, size_t cap)`**: Constructor that initializes the vector from a given array `_data` with a specified length `len` and capacity `cap`.\n*   **`Vector(const Vector\u0026 other)`**: Copy constructor that creates a copy of another vector.\n\n### Data Manipulation Methods\n\n*   **`void set_coords(T* _data, size_t len, size_t cap)`**: Sets the vector's data from a provided array `_data`.\n*   **`void push_back(T val)`**: Adds an element `val` to the end of the vector, resizing if necessary.\n*   **`void push_front(T val)`**: Adds an element `val` to the beginning of the vector, resizing if necessary.\n*   **`void pop_back()`**: Removes the last element of the vector.\n*   **`void pop_front()`**: Removes the first element of the vector.\n*   **`void insert(size_t index, T val)`**: Inserts an element `val` at the specified `index`.\n*   **`void remove(size_t index)`**: Removes the element at the specified `index`.\n*   **`void clear()`**: Clears the vector, resetting it to its initial state (capacity 8, size 0).\n*   **`void resize(size_t new_capacity)`**: Changes the capacity of the vector to `new_capacity`.\n\n### Information Methods\n\n*   **`size_t capacity() const noexcept`**: Returns the current capacity of the vector.\n*   **`size_t size() const noexcept`**: Returns the current number of elements in the vector.\n*   **`bool empty() const noexcept`**: Checks if the vector is empty.\n\n### Operators\n\n*   **`Vector\u0026 operator+=(const Vector\u0026 other)`**: Appends the elements of another vector to the current vector.\n*   **`Vector operator+(const Vector\u0026 right) const`**: Returns a new vector that is the result of the addition of two vectors.\n*   **`Inner operator[](size_t index)`**: Overload of the `[]` operator for mutable access to the vector's elements.\n*   **`const T\u0026 operator[](size_t index) const`**: Overload of the `[]` operator for read-only access to the vector's elements.\n\n### Inner Class\n\n*   The `Inner` class is a helper class used to implement the overloaded `[]` operator for both reading and writing of elements.\n\n### Exceptions\n\nThis dynamic array implementation throws exceptions in the following situations:\n\n*   **`VectorIndexError`**: Thrown when trying to access an invalid index.\n*   **`VectorMemoryError`**: Thrown when there is an error during memory allocation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherealdevdan%2Fcustomvector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftherealdevdan%2Fcustomvector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherealdevdan%2Fcustomvector/lists"}