https://github.com/aceinetx/linked
Double-linked array library for c++
https://github.com/aceinetx/linked
Last synced: 5 months ago
JSON representation
Double-linked array library for c++
- Host: GitHub
- URL: https://github.com/aceinetx/linked
- Owner: aceinetx
- Created: 2024-09-12T19:30:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-13T20:06:28.000Z (almost 2 years ago)
- Last Synced: 2024-12-31T00:12:28.984Z (over 1 year ago)
- Language: C++
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# linked
a double-linked array library for c++
## Features
- std::vector-like functions
- uses class templates
- minimal standard library usage
- minimal dependencies
- easy to set up
- python multiplication
# Example
```c++
#include "linked.h"
#include
int main(){
aceinetzxx::linked arr;
arr.push_back(69);
arr.push_back(123);
// get the first number
std::cout << "The number is " << arr[0] << std::endl; // should print "The number is 69"
// get the last number
std::cout << "The last number is " << arr.back() << std::endl; // should also print "The last number is 123"
// set the number at index
arr[0] = 42;
// to set the last number we can use .back() too
arr.back() = 70;
// get the size of array
size_t array_size = arr.size();
arr.pop_back(); // this removes the last element and returns it
// but no need to do that in this case because deconstructor cleans everything
}
```