-
Notifications
You must be signed in to change notification settings - Fork 87
Howto: Write a View
Hannes Hauswedell edited this page Feb 27, 2018
·
10 revisions
See Ranges for an explanation of what a view is.
All of these HowTos require:
- GCC >= 6 or Clang >= 3.7
- an up-to-date cone of the range-v3 git repository
- building your apps with
-std=c++14 -I/path/to/range-v3/include
A small tutorial to write basic views as combinations/modifications of existing views. Everyone working on SeqAn3 should understand this.
std::string s{"ACGTTTATGT"};
// make reverse complement view
auto comp_view = // TODO: implement
std::cout << comp_view << '\n'; // should print [A,C,A,T,A,A,A,C,G,T]
// create infix from [1, 6)
auto comp_view_inf = // TODO: implement
std::cout << comp_view_inf << '\n'; // should print [C,A,T,A,A]
// transform back
auto orig_inf = // TODO: implement
std::cout << orig_inf << '\n'; // should print [T,T,A,T,G]std::string s{"ACGTTTATGTTTACGT"};
auto v = // TODO: implement
std::cout << v << '\n'; // should print [T,F,M,F,T,X]HowTo write a View : An in-depth look at writing complete view implementations. Relevant for people implementing a complete view π