Spec
ZipContainerViewTies one or more containers into a non-resizable container view together.
Ties one or more containers into a non-resizable container view together.
Extends | ContainerView |
---|---|
All Extended | ContainerView |
All Impl'd | AssignableConcept, ContainerConcept, DestructibleConcept |
Defined in | <seqan/sequence.h> |
Signature |
template <typename... TContTypes, typename TSpec>
class ContainerView<std::tuple<TContTypes...>, ZipContainer<TSpec> >
|
Template Parameters
TContTypes |
One or more types of all containers tied into the zip container view. |
---|---|
TSpec |
The specialization type. |
Interface Function Overview
Interface Functions Inherited From ContainerView
Interface Functions Inherited From AssignableConcept
Interface Functions Inherited From ContainerConcept
Interface Metafunction Overview
Interface Metafunctions Inherited From ContainerConcept
Detailed Description
Example
The following example demonstrates the functionality of the ZipContainerView:
#include <iostream>
#include <seqan/sequence.h>
#include <seqan/stream.h> // for output
using namespace seqan2;
int main()
{
StringSet<CharString> names;
StringSet<CharString> surnames;
String<int> ages;
appendValue(names, "John");
appendValue(names, "Johnny");
appendValue(names, "Garfield");
appendValue(surnames, "Doe");
appendValue(surnames, "Donny");
appendValue(surnames, "the Cat");
appendValue(ages, 98);
appendValue(ages, 20);
appendValue(ages, 42);
auto pRegister = makeZipView(names, surnames, ages);
for (auto person : pRegister)
std::cout << std::get<1>(person) << ", " << std::get<0>(person) << ": " << std::get<2>(person) << std::endl;
return 0;
}
This outputs the following to the console:
Doe, John: 98 Donny, Johnny: 20 the Cat, Garfield: 42