https://github.com/seqan/seqan-std
Implementation of several C++23 views
https://github.com/seqan/seqan-std
Last synced: 9 months ago
JSON representation
Implementation of several C++23 views
- Host: GitHub
- URL: https://github.com/seqan/seqan-std
- Owner: seqan
- License: other
- Created: 2023-05-12T11:56:35.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-19T13:06:31.000Z (over 1 year ago)
- Last Synced: 2024-12-19T14:23:12.116Z (over 1 year ago)
- Language: C++
- Size: 164 KB
- Stars: 0
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# seqan-std
Implementation of several C++23 views
## Quick start
### CMake with CPM
```cmake
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0
cmake_minimum_required (VERSION 3.25)
project (example
LANGUAGES CXX)
# CPM Documentation:
# Adding CPM: https://github.com/cpm-cmake/CPM.cmake?tab=readme-ov-file#adding-cpm
# Example : https://github.com/cpm-cmake/CPM.cmake?tab=readme-ov-file#full-cmakelists-example
# For CPM's example, "${CPM_FILE}" would be "cmake/CPM.cmake"
include (${CPM_FILE})
CPMAddPackage ("gh:seqan/seqan-std#main")
add_executable (example example.cpp)
target_link_libraries (example seqan::std)
```
### Example
```cpp
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include
#include
#include
#include
int main()
{
std::vector vec{"Hello", "World", "!"};
for (auto const [index, str] : seqan::stl::views::enumerate(vec))
std::cout << index << ": " << str << '\n';
}
```
### Output
```txt
0: Hello
1: World
2: !
```