Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alexdenisov/sgl

SGL - Swift Generic Library. Highly inspired by C++ STL.
https://github.com/alexdenisov/sgl

Last synced: 2 days ago
JSON representation

SGL - Swift Generic Library. Highly inspired by C++ STL.

Awesome Lists containing this project

README

        

### SGL - Swift Generic Library. Highly inspired by C++ STL

This simple code
```swift
import sgl

func print_array(begin: forward_iterator, end: forward_iterator) {
var it = begin
while it != end {
let value = (it++).value()!
print("\(value) ")
}
println()
}

var a = array(1, 2, 3, 4, 5)

print_array(a.begin(), a.end())
print_array(a.rbegin(), a.rend())
```

will print
```
1 2 3 4 5
5 4 3 2 1
```

### TODO

##### Containers

- [x] array
- [ ] vector
- [ ] deque
- [ ] list
- [ ] forward_list
- [ ] set
- [ ] multiset
- [ ] unordered set
- [ ] map
- [ ] multimap
- [ ] unordered map
- [ ] stack
- [ ] queue
- [ ] priority queue

##### Iterators

- [ ] input iterator
- [ ] output iterator
- [x] forward iterator
- [x] bidirectional iterator
- [x] random access iterator

##### Algorithms

_to be added_

##### Numerics

_to be added_

### License

The source code distributed under MIT license. See LICENSE for details.