Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/alexdenisov/sgl
- Owner: AlexDenisov
- License: mit
- Created: 2014-07-30T21:08:42.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-12T08:07:55.000Z (about 10 years ago)
- Last Synced: 2023-03-23T00:39:13.940Z (over 1 year ago)
- Language: Swift
- Size: 232 KB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### SGL - Swift Generic Library. Highly inspired by C++ STL
This simple code
```swift
import sglfunc 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.