diff --git a/CHANGELOG.md b/CHANGELOG.md index 12a5fae12c..cee332d784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,6 +136,10 @@ regression test suite and patches at https://github.com/seqan/seqan3/tree/master `seqan3::phred68legacy(phred_type)`. * Renamed `seqan3::quality_base` to `seqan3::phred_base` ([\#2539](https://github.com/seqan/seqan3/pull/2539)). +* Added the `seqan3::literals` namespace containing all literals. This adds the option to use + `using namespace seqan3::literals` to import literal operators. The old way of explicitly importing specific + operators via `using seqan3::operator""_{dna4, rna4, ...}` is not affected by this change + ([\#2568](https://github.com/seqan/seqan3/pull/2568)). #### Argument Parser diff --git a/doc/tutorial/alphabet/alphabet_gc_content.cpp b/doc/tutorial/alphabet/alphabet_gc_content.cpp index 3d08fca76d..fd683ed5e2 100644 --- a/doc/tutorial/alphabet/alphabet_gc_content.cpp +++ b/doc/tutorial/alphabet/alphabet_gc_content.cpp @@ -8,10 +8,11 @@ #include #include // optional: use views to convert the input string to a dna5 sequence -using seqan3::operator""_dna5; int main (int argc, char * argv[]) { + using namespace seqan3::literals; + std::string input{}; seqan3::argument_parser parser("GC-Content", argc, argv); parser.add_positional_option(input, "Specify an input sequence."); diff --git a/doc/tutorial/alphabet/alphabet_main.cpp b/doc/tutorial/alphabet/alphabet_main.cpp index e3bdd1c448..33792e447b 100644 --- a/doc/tutorial/alphabet/alphabet_main.cpp +++ b/doc/tutorial/alphabet/alphabet_main.cpp @@ -8,10 +8,10 @@ //! [create] #include // for working with alphabets directly -using seqan3::operator""_dna4; - int main () { + using namespace seqan3::literals; + // Two objects of seqan3::dna4 alphabet constructed with a char literal. seqan3::dna4 ade = 'A'_dna4; seqan3::dna4 gua = 'G'_dna4; @@ -79,8 +79,7 @@ int main () assert(some_nucl == "AGT"_dna4); //! [phred] - using seqan3::operator""_dna4; - using seqan3::operator""_phred42; + using namespace seqan3::literals; seqan3::phred42 phred; phred.assign_phred(2); @@ -98,7 +97,7 @@ int main () // Assign a gap symbol to a gapped RNA alphabet. seqan3::gapped sym = seqan3::gap{}; // => - - using seqan3::operator""_rna5; + using namespace seqan3::literals; // Each seqan3::rna5 symbol is still valid. sym = 'U'_rna5; // => U @@ -108,7 +107,7 @@ int main () assert(size2 == 6u); //! [containers] - using seqan3::operator""_dna5; + using namespace seqan3::literals; // Examples of different container types with SeqAn's alphabets. std::vector dna_sequence{"GATTANAG"_dna5}; diff --git a/doc/tutorial/concepts/index.md b/doc/tutorial/concepts/index.md index be0aecca28..ca6d0d5019 100644 --- a/doc/tutorial/concepts/index.md +++ b/doc/tutorial/concepts/index.md @@ -170,13 +170,12 @@ Write a small program, similar to the one above with the following "skeleton": ```cpp // which includes? -using seqan3::operator""_dna5; -using seqan3::operator""_aa27; - // Add one or more `void print` function template(s) here // int main() { + using namespace seqan3::literals; + auto d = 'A'_dna5; auto a = 'L'_aa27; auto g = seqan3::gap{}; diff --git a/doc/tutorial/concepts/overloading_solution1.cpp b/doc/tutorial/concepts/overloading_solution1.cpp index ef547460ae..1f524ee1e9 100644 --- a/doc/tutorial/concepts/overloading_solution1.cpp +++ b/doc/tutorial/concepts/overloading_solution1.cpp @@ -7,11 +7,11 @@ void print(t const v) std::cout << "I am an alphabet and my value as char is: " << seqan3::to_char(v) << '\n'; } -using seqan3::operator""_dna5; -using seqan3::operator""_aa27; int main() { + using namespace seqan3::literals; + auto d = 'A'_dna5; auto a = 'L'_aa27; auto g = seqan3::gap{}; diff --git a/doc/tutorial/concepts/overloading_solution2.cpp b/doc/tutorial/concepts/overloading_solution2.cpp index 169270b187..447cf93728 100644 --- a/doc/tutorial/concepts/overloading_solution2.cpp +++ b/doc/tutorial/concepts/overloading_solution2.cpp @@ -14,11 +14,10 @@ void print(t const v) << " and my complement is: " << seqan3::to_char(seqan3::complement(v)) << '\n'; } -using seqan3::operator""_dna5; -using seqan3::operator""_aa27; - int main() { + using namespace seqan3::literals; + auto d = 'A'_dna5; auto a = 'L'_aa27; auto g = seqan3::gap{}; diff --git a/doc/tutorial/introduction/index.md b/doc/tutorial/introduction/index.md index f5a122524f..c7e4223512 100644 --- a/doc/tutorial/introduction/index.md +++ b/doc/tutorial/introduction/index.md @@ -155,7 +155,7 @@ to learn more. \note We encourage you to avoid declaring `using namespace seqan3;`. This has the additional benefit of easily distinguishing between library features and standard C++. The only exception are string literals, where we often use -`using seqan3::operator""_dna4;` for convenience. +`using namespace seqan3::literals` for convenience. \note We use a lot of Modern C++ in SeqAn so some things might look alien at first, diff --git a/doc/tutorial/introduction/introduction_align.cpp b/doc/tutorial/introduction/introduction_align.cpp index 41079c26f9..89ba2bd17a 100644 --- a/doc/tutorial/introduction/introduction_align.cpp +++ b/doc/tutorial/introduction/introduction_align.cpp @@ -13,14 +13,14 @@ int main() { + using namespace seqan3::literals; + auto tmp_dir = std::filesystem::temp_directory_path(); std::string filename{tmp_dir/"seq.fasta"}; { // Create a /tmp/seq.fasta file. seqan3::sequence_file_output file_out{filename}; - using seqan3::operator""_dna5; - file_out.emplace_back("ACGTGATG"_dna5, std::string{"seq1"}); file_out.emplace_back("AGTGATACT"_dna5, std::string{"seq2"}); } diff --git a/doc/tutorial/pairwise_alignment/configurations.cpp b/doc/tutorial/pairwise_alignment/configurations.cpp index 2481da8e41..fd8a97b84e 100644 --- a/doc/tutorial/pairwise_alignment/configurations.cpp +++ b/doc/tutorial/pairwise_alignment/configurations.cpp @@ -47,8 +47,7 @@ int main() { //! [scoring_scheme] -using seqan3::operator""_dna4; -using seqan3::operator""_aa27; +using namespace seqan3::literals; // Define a simple scoring scheme with match and mismatch cost and get the score. seqan3::nucleotide_scoring_scheme nc_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}; diff --git a/doc/tutorial/pairwise_alignment/pa_assignment_3_solution.cpp b/doc/tutorial/pairwise_alignment/pa_assignment_3_solution.cpp index 96dfea376b..c29454ee03 100644 --- a/doc/tutorial/pairwise_alignment/pa_assignment_3_solution.cpp +++ b/doc/tutorial/pairwise_alignment/pa_assignment_3_solution.cpp @@ -7,10 +7,10 @@ #include #include -using seqan3::operator""_aa27; - int main() { + using namespace seqan3::literals; + std::vector vec{"MANLGYZW"_aa27, "LCKRLGNM"_aa27, "KPSKPRDYEDG"_aa27, diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_first_global.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_first_global.cpp index 5460fa59d8..d73cde2fc0 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_first_global.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_first_global.cpp @@ -5,10 +5,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + seqan3::dna4_vector s1 = "ACGTGAACTGACT"_dna4; seqan3::dna4_vector s2 = "ACGAAGACCGAT"_dna4; diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_1.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_1.cpp index 4394d9da9c..c7fda4c079 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_1.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_1.cpp @@ -7,10 +7,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + std::vector vec{"ACGTGAACTGACT"_dna4, "ACGAAGACCGAT"_dna4, "ACGTGACTGACT"_dna4, diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_2.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_2.cpp index 6530164d12..286aaa96ac 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_2.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_2.cpp @@ -7,10 +7,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + std::vector vec{"ACGTGAACTGACT"_dna4, "ACGAAGACCGAT"_dna4, "ACGTGACTGACT"_dna4, diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_3.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_3.cpp index ea2ac601b7..c74a0ab2e7 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_3.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_3.cpp @@ -4,10 +4,10 @@ #include // for seqan3::operator""_aa27 #include -using seqan3::operator""_aa27; - int main() { + using namespace seqan3::literals; + auto seq1 = "QFSEEILSDIYCWMLQCGQERAV"_aa27; auto seq2 = "AFLPGWQEENKLSKIWMKDCGCLW"_aa27; diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_4.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_4.cpp index b37367bbe6..6d60ba2b5a 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_4.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_4.cpp @@ -5,10 +5,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + auto seq1 = "TTACGTACGGACTAGCTACAACATTACGGACTAC"_dna4; auto seq2 = "GGACGACATGACGTACGACTTTACGTACGACTAGC"_dna4; diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp index 949ec585f1..21650e6a1c 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp @@ -5,10 +5,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + auto seq1 = "TTACGTACGGACTAGCTACAACATTACGGACTAC"_dna4; auto seq2 = "GGACGACATGACGTACGACTTTACGTACGACTAGC"_dna4; diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_6.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_6.cpp index 0a41a60557..a19ebdea1d 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_6.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_6.cpp @@ -8,10 +8,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + std::vector vec{"ACGTGACTGACT"_dna4, "ACGAAGACCGAT"_dna4, "ACGTGACTGACT"_dna4, diff --git a/doc/tutorial/ranges/range_solution4.cpp b/doc/tutorial/ranges/range_solution4.cpp index 39a5d7a307..026fd33122 100644 --- a/doc/tutorial/ranges/range_solution4.cpp +++ b/doc/tutorial/ranges/range_solution4.cpp @@ -5,10 +5,10 @@ #include // for debug_stream #include // include bitcompressed vector -using seqan3::operator""_dna4; - int main(int argc, char ** argv) { + using namespace seqan3::literals; + seqan3::argument_parser myparser("Vector-implementations-comparison", argc, argv); size_t size{}; bool use_bitvector{}; diff --git a/doc/tutorial/sam_file/sam_file_snippets.cpp b/doc/tutorial/sam_file/sam_file_snippets.cpp index 6489cd28f4..bf8a7c992a 100644 --- a/doc/tutorial/sam_file/sam_file_snippets.cpp +++ b/doc/tutorial/sam_file/sam_file_snippets.cpp @@ -111,7 +111,7 @@ int main() { //![alignments_with_ref] - using seqan3::operator""_dna5; + using namespace seqan3::literals; auto filename = std::filesystem::temp_directory_path()/"example.sam"; diff --git a/doc/tutorial/sam_file/sam_file_solution3.cpp b/doc/tutorial/sam_file/sam_file_solution3.cpp index 0d44cc892a..90fd20721a 100644 --- a/doc/tutorial/sam_file/sam_file_solution3.cpp +++ b/doc/tutorial/sam_file/sam_file_solution3.cpp @@ -3,10 +3,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + std::vector ids = {"read1", "read2"}; std::vector> seqs = {"ACGATCGACTAGCTACGATCAGCTAGCAG"_dna4, "AGAAAGAGCGAGGCTATTTTAGCGAGTTA"_dna4}; diff --git a/doc/tutorial/search/search_solution1.cpp b/doc/tutorial/search/search_solution1.cpp index 63d94d7e6c..48192eef88 100644 --- a/doc/tutorial/search/search_solution1.cpp +++ b/doc/tutorial/search/search_solution1.cpp @@ -10,10 +10,10 @@ seqan3::cleanup index_file{"index.file"}; #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + seqan3::dna4_vector text{"CGCTGTCTGAAGGATGAGTGTCAGCCAGTGTAACCCGATGAGCTACCCAGTAGTCGAACTGGGCCAGACAACCCGGCGCTAATGCACTCA"_dna4}; seqan3::fm_index index{text}; diff --git a/doc/tutorial/search/search_solution2.cpp b/doc/tutorial/search/search_solution2.cpp index 151a89f0b8..699339e351 100644 --- a/doc/tutorial/search/search_solution2.cpp +++ b/doc/tutorial/search/search_solution2.cpp @@ -3,7 +3,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; void run_text_single() { diff --git a/doc/tutorial/search/search_solution3.cpp b/doc/tutorial/search/search_solution3.cpp index 611fdd18be..25e6b0461b 100644 --- a/doc/tutorial/search/search_solution3.cpp +++ b/doc/tutorial/search/search_solution3.cpp @@ -4,10 +4,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + seqan3::dna4_vector text{"CGCTGTCTGAAGGATGAGTGTCAGCCAGTGTAACCCGATGAGCTACCCAGTAGTCGAACTGGGCCAGACAACCCGGCGCTAATGCACTCA"_dna4}; seqan3::fm_index index{text}; diff --git a/doc/tutorial/search/search_solution4.cpp b/doc/tutorial/search/search_solution4.cpp index 6c9d9cb4db..f8afd79292 100644 --- a/doc/tutorial/search/search_solution4.cpp +++ b/doc/tutorial/search/search_solution4.cpp @@ -3,10 +3,10 @@ #include #include -using seqan3::operator""_dna4; - int main() { + using namespace seqan3::literals; + seqan3::dna4_vector text{"CGCTGTCTGAAGGATGAGTGTCAGCCAGTGTAACCCGATGAGCTACCCAGTAGTCGAACTGGGCCAGACAACCCGGCGCTAATGCACTCA"_dna4}; seqan3::dna4_vector query{"GCT"_dna4}; diff --git a/doc/tutorial/search/search_solution5.cpp b/doc/tutorial/search/search_solution5.cpp index 6000b7868d..fcb1ebbc60 100644 --- a/doc/tutorial/search/search_solution5.cpp +++ b/doc/tutorial/search/search_solution5.cpp @@ -6,7 +6,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; // Define the pairwise alignment configuration globally. inline constexpr auto align_config = seqan3::align_cfg::method_global{ diff --git a/doc/tutorial/search/views/minimiser/minimiser_snippets.cpp b/doc/tutorial/search/views/minimiser/minimiser_snippets.cpp index ca4bf844ec..331958c9ed 100644 --- a/doc/tutorial/search/views/minimiser/minimiser_snippets.cpp +++ b/doc/tutorial/search/views/minimiser/minimiser_snippets.cpp @@ -6,7 +6,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; int main() { diff --git a/doc/tutorial/search/views/minimiser/minimiser_solution1.cpp b/doc/tutorial/search/views/minimiser/minimiser_solution1.cpp index b57ce5138d..c6fe8a1cd3 100644 --- a/doc/tutorial/search/views/minimiser/minimiser_solution1.cpp +++ b/doc/tutorial/search/views/minimiser/minimiser_solution1.cpp @@ -2,7 +2,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; int main() { diff --git a/doc/tutorial/search/views/minimiser/minimiser_solution2.cpp b/doc/tutorial/search/views/minimiser/minimiser_solution2.cpp index a06c76a333..9824ab42a2 100644 --- a/doc/tutorial/search/views/minimiser/minimiser_solution2.cpp +++ b/doc/tutorial/search/views/minimiser/minimiser_solution2.cpp @@ -2,8 +2,7 @@ #include #include -using seqan3::operator""_dna4; -using seqan3::operator""_shape; +using namespace seqan3::literals; int main() { diff --git a/doc/tutorial/search/views/minimiser/minimiser_solution3.cpp b/doc/tutorial/search/views/minimiser/minimiser_solution3.cpp index 24487a3f31..427c6e1e54 100644 --- a/doc/tutorial/search/views/minimiser/minimiser_solution3.cpp +++ b/doc/tutorial/search/views/minimiser/minimiser_solution3.cpp @@ -3,8 +3,7 @@ #include #include -using seqan3::operator""_dna4; -using seqan3::operator""_shape; +using namespace seqan3::literals; int main() { diff --git a/doc/tutorial/search/views/minimiser/seed_example.cpp b/doc/tutorial/search/views/minimiser/seed_example.cpp index cdb6ff4670..84d7d5bf78 100644 --- a/doc/tutorial/search/views/minimiser/seed_example.cpp +++ b/doc/tutorial/search/views/minimiser/seed_example.cpp @@ -2,7 +2,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; int main() { diff --git a/include/seqan3/alphabet/all.hpp b/include/seqan3/alphabet/all.hpp index 2bb74790b4..72eeac2de1 100644 --- a/include/seqan3/alphabet/all.hpp +++ b/include/seqan3/alphabet/all.hpp @@ -169,6 +169,14 @@ * A container over an seqan3::alphabet automatically models the seqan3::sequence concept. */ +/*!\namespace seqan3::literals + * \brief The SeqAn namespace for literals. + * \details + * + * This namespace can be imported to use SeqAn3's literal operators: + * \include test/snippet/alphabet/all_literal.cpp + */ + #pragma once #include diff --git a/include/seqan3/alphabet/aminoacid/aa10li.hpp b/include/seqan3/alphabet/aminoacid/aa10li.hpp index 2a49b428d4..e914b559cb 100644 --- a/include/seqan3/alphabet/aminoacid/aa10li.hpp +++ b/include/seqan3/alphabet/aminoacid/aa10li.hpp @@ -189,16 +189,20 @@ using aa10li_vector = std::vector; // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ /*!\name Literals * \{ */ - /*!\brief The seqan3::aa10li char literal. * \param[in] c The character to assign. * \relates seqan3::aa10li * \returns seqan3::aa10li * + * You can use this char literal to assign a seqan3::aa10li character: + * \include test/snippet/alphabet/aminoacid/aa10li_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr aa10li operator""_aa10li(char const c) noexcept @@ -206,16 +210,14 @@ constexpr aa10li operator""_aa10li(char const c) noexcept return aa10li{}.assign_char(c); } -/*!\brief The seqan3::aa10li string literal. +/*!\brief The seqan3::aa10li string literal. * \param[in] s A pointer to the character string to assign. * \param[in] n The size of the character string to assign. * \relates seqan3::aa10li * \returns seqan3::aa10li_vector * * You can use this string literal to easily assign to aa10li_vector: - * - * \attention - * All seqan3 literals are in the namespace seqan3! + * \include test/snippet/alphabet/aminoacid/aa10li_literal.cpp * * \stableapi{Since version 3.1.} */ @@ -231,4 +233,6 @@ inline aa10li_vector operator""_aa10li(char const * const s, size_t const n) } //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/aminoacid/aa10murphy.hpp b/include/seqan3/alphabet/aminoacid/aa10murphy.hpp index 1dd19a7660..bddaa69b65 100644 --- a/include/seqan3/alphabet/aminoacid/aa10murphy.hpp +++ b/include/seqan3/alphabet/aminoacid/aa10murphy.hpp @@ -188,16 +188,20 @@ using aa10murphy_vector = std::vector; // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ /*!\name Literals * \{ */ - /*!\brief The seqan3::aa10murphy char literal. * \param[in] c The character to assign. * \relates seqan3::aa10murphy * \returns seqan3::aa10murphy * + * You can use this char literal to assign a seqan3::aa10murphy character: + * \include test/snippet/alphabet/aminoacid/aa10murphy_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr aa10murphy operator""_aa10murphy(char const c) noexcept @@ -212,9 +216,7 @@ constexpr aa10murphy operator""_aa10murphy(char const c) noexcept * \returns seqan3::aa10murphy_vector * * You can use this string literal to easily assign to aa10murphy_vector: - * - * \attention - * All seqan3 literals are in the namespace seqan3! + * \include test/snippet/alphabet/aminoacid/aa10murphy_literal.cpp * * \stableapi{Since version 3.1.} */ @@ -230,4 +232,6 @@ inline aa10murphy_vector operator""_aa10murphy(char const * const s, size_t cons } //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/aminoacid/aa20.hpp b/include/seqan3/alphabet/aminoacid/aa20.hpp index 965468b12b..4f934732bb 100644 --- a/include/seqan3/alphabet/aminoacid/aa20.hpp +++ b/include/seqan3/alphabet/aminoacid/aa20.hpp @@ -56,7 +56,7 @@ namespace seqan3 * in the human genome: a comparison with sense codon usage. * BMC Genomics, 17, 366. https://doi.org/10.1186/s12864-016-2692-4 * - * \include test/snippet/alphabet/aminoacid/aa20_construction.cpp + * \include test/snippet/alphabet/aminoacid/aa20.cpp * * \stableapi{Since version 3.1.} */ @@ -155,14 +155,10 @@ class aa20 : public aminoacid_base } }; -} // namespace seqan3 - // ------------------------------------------------------------------ // containers // ------------------------------------------------------------------ -namespace seqan3 -{ /*!\brief Alias for an std::vector of seqan3::aa20. * \relates aa20 * @@ -170,24 +166,21 @@ namespace seqan3 */ using aa20_vector = std::vector; -} // namespace seqan3 - // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ - -namespace seqan3 +inline namespace literals { /*!\name Literals * \{ */ - /*!\brief The seqan3::aa20 char literal. * \param[in] c The character to assign. * \relates seqan3::aa20 * \returns seqan3::aa20 * + * You can use this char literal to assign a seqan3::aa20 character: * \include test/snippet/alphabet/aminoacid/aa20_char_literal.cpp * * \stableapi{Since version 3.1.} @@ -204,12 +197,8 @@ constexpr aa20 operator""_aa20(char const c) noexcept * \returns seqan3::aa20_vector * * You can use this string literal to easily assign to aa20_vector: - * * \include test/snippet/alphabet/aminoacid/aa20_literal.cpp * - * \attention - * All seqan3 literals are in the namespace seqan3! - * * \stableapi{Since version 3.1.} */ inline aa20_vector operator""_aa20(char const * const s, size_t const n) @@ -224,4 +213,6 @@ inline aa20_vector operator""_aa20(char const * const s, size_t const n) } //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/aminoacid/aa27.hpp b/include/seqan3/alphabet/aminoacid/aa27.hpp index da79c3bc1f..bbe2d6c6c2 100644 --- a/include/seqan3/alphabet/aminoacid/aa27.hpp +++ b/include/seqan3/alphabet/aminoacid/aa27.hpp @@ -37,7 +37,7 @@ namespace seqan3 * Instead initialise/assign from the character literal or use the * function seqan3::aa27::assign_char(). * - * \include test/snippet/alphabet/aminoacid/aa27_construction.cpp + * \include test/snippet/alphabet/aminoacid/aa27.cpp * * \stableapi{Since version 3.1.} */ @@ -137,14 +137,10 @@ class aa27 : public aminoacid_base } }; -} // namespace seqan3 - // ------------------------------------------------------------------ // containers // ------------------------------------------------------------------ -namespace seqan3 -{ /*!\brief Alias for an std::vector of seqan3::aa27. * \relates aa27 * @@ -152,24 +148,21 @@ namespace seqan3 */ using aa27_vector = std::vector; -} // namespace seqan3 - // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ - -namespace seqan3 +inline namespace literals { /*!\name Literals * \{ */ - /*!\brief The seqan3::aa27 char literal. * \param[in] c The character to assign. * \relates seqan3::aa27 * \returns seqan3::aa27 * + * You can use this char literal to assign a seqan3::aa27 character: * \include test/snippet/alphabet/aminoacid/aa27_char_literal.cpp * * \stableapi{Since version 3.1.} @@ -186,12 +179,8 @@ constexpr aa27 operator""_aa27(char const c) noexcept * \returns seqan3::aa27_vector * * You can use this string literal to easily assign to aa27_vector: - * * \include test/snippet/alphabet/aminoacid/aa27_literal.cpp * - * \attention - * All seqan3 literals are in the namespace seqan3! - * * \stableapi{Since version 3.1.} */ inline aa27_vector operator""_aa27(char const * const s, size_t const n) @@ -206,4 +195,6 @@ inline aa27_vector operator""_aa27(char const * const s, size_t const n) } //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/cigar/cigar.hpp b/include/seqan3/alphabet/cigar/cigar.hpp index 0eaf799701..78156a23dc 100644 --- a/include/seqan3/alphabet/cigar/cigar.hpp +++ b/include/seqan3/alphabet/cigar/cigar.hpp @@ -82,7 +82,7 @@ class cigar : public alphabet_tuple_base & operator<<(debug_stream_type & s, cig return s; } +inline namespace literals +{ + // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ -/*!\name Literals +/*!\name Other literals * \{ */ /*!\brief The seqan3::cigar::operation char literal. - * \relates seqan3::cigar + * \relatesalso seqan3::cigar * \returns seqan3::cigar::operation * + * You can use this char literal to assign a seqan3::cigar_operation character: + * \include test/snippet/alphabet/cigar/cigar_operation_char_literal.cpp + * * \stableapi{Since version 3.1.} */ inline cigar::operation operator""_cigar_operation(char const c) noexcept @@ -240,4 +246,6 @@ SEQAN3_DEPRECATED_310 inline cigar::operation operator""_cigar_op(char const c) } //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/nucleotide/dna15.hpp b/include/seqan3/alphabet/nucleotide/dna15.hpp index 156c5d5250..989c122021 100644 --- a/include/seqan3/alphabet/nucleotide/dna15.hpp +++ b/include/seqan3/alphabet/nucleotide/dna15.hpp @@ -162,15 +162,20 @@ using dna15_vector = std::vector; // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ -/*!\name Literals +/*!\name Nucleotide literals * \{ */ - /*!\brief The seqan3::dna15 char literal. - * \relates seqan3::dna15 + * \relatesalso seqan3::dna15 * \returns seqan3::dna15 * \details + * + * You can use this char literal to assign a seqan3::dna15 character: + * \include test/snippet/alphabet/nucleotide/dna15_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr dna15 operator""_dna15(char const c) noexcept @@ -179,11 +184,10 @@ constexpr dna15 operator""_dna15(char const c) noexcept } /*!\brief The seqan3::dna15 string literal. - * \relates seqan3::dna15 + * \relatesalso seqan3::dna15 * \returns seqan3::dna15_vector * * You can use this string literal to easily assign to dna15_vector: - * * \include test/snippet/alphabet/nucleotide/dna15_literal.cpp * * \stableapi{Since version 3.1.} @@ -200,6 +204,8 @@ inline dna15_vector operator""_dna15(char const * s, std::size_t n) } //!\} +} // inline namespace literals + // ------------------------------------------------------------------ // dna15 (deferred definition) // ------------------------------------------------------------------ diff --git a/include/seqan3/alphabet/nucleotide/dna16sam.hpp b/include/seqan3/alphabet/nucleotide/dna16sam.hpp index 3b51f7283c..9968f4aede 100644 --- a/include/seqan3/alphabet/nucleotide/dna16sam.hpp +++ b/include/seqan3/alphabet/nucleotide/dna16sam.hpp @@ -148,19 +148,30 @@ class dna16sam : public nucleotide_base */ using dna16sam_vector = std::vector; +//!\deprecated Please use seqan3::dna16sam instead. +using sam_dna16 SEQAN3_DEPRECATED_310 = seqan3::dna16sam; + +//!\deprecated Please use seqan3::dna16sam_vector instead. +using sam_dna16_vector SEQAN3_DEPRECATED_310 = dna16sam_vector; + // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ -/*!\name Literals +/*!\name Nucleotide literals * \{ */ - /*!\brief The seqan3::dna16sam char literal. - * \relates seqan3::dna16sam + * \relatesalso seqan3::dna16sam * \returns seqan3::dna16sam * \param[in] c The character to assign from. * \details + * + * You can use this char literal to assign a seqan3::dna16sam character: + * \include test/snippet/alphabet/nucleotide/dna16sam_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr dna16sam operator""_dna16sam(char const c) noexcept @@ -169,13 +180,12 @@ constexpr dna16sam operator""_dna16sam(char const c) noexcept } /*!\brief The seqan3::dna16sam string literal. - * \relates seqan3::dna16sam + * \relatesalso seqan3::dna16sam * \returns seqan3::dna16sam_vector * \param[in] s The string literal to assign from. * \param[in] n The length of the string literal s. * * You can use this string literal to easily assign to seqan3::dna16sam_vector: - * * \include test/snippet/alphabet/nucleotide/dna16sam_literal.cpp * * \stableapi{Since version 3.1.} @@ -190,8 +200,22 @@ inline dna16sam_vector operator""_dna16sam(char const * s, size_t n) return r; } + +//!\deprecated Please use seqan3::operator""_dna16sam instead. +SEQAN3_DEPRECATED_310 constexpr dna16sam operator""_sam_dna16(char const c) noexcept +{ + return seqan3::operator""_dna16sam(c); +} + +//!\deprecated Please use seqan3::operator""_dna16sam instead. +SEQAN3_DEPRECATED_310 inline dna16sam_vector operator""_sam_dna16(char const * s, size_t n) +{ + return seqan3::operator""_dna16sam(s, n); +} //!\} +} // inline namespace literals + // ------------------------------------------------------------------ // complement deferred definition // ------------------------------------------------------------------ @@ -217,24 +241,3 @@ constexpr std::array dna16sam::complement_tab }; } // namespace seqan3 - -namespace seqan3 -{ -//!\deprecated Please use seqan3::dna16sam instead. -using sam_dna16 SEQAN3_DEPRECATED_310 = seqan3::dna16sam; - -//!\deprecated Please use seqan3::dna16sam_vector instead. -using sam_dna16_vector SEQAN3_DEPRECATED_310 = dna16sam_vector; - -//!\deprecated Please use seqan3::operator""_dna16sam instead. -SEQAN3_DEPRECATED_310 constexpr dna16sam operator""_sam_dna16(char const c) noexcept -{ - return seqan3::operator""_dna16sam(c); -} - -//!\deprecated Please use seqan3::operator""_dna16sam instead. -SEQAN3_DEPRECATED_310 inline dna16sam_vector operator""_sam_dna16(char const * s, size_t n) -{ - return seqan3::operator""_dna16sam(s, n); -} -} // namespace seqan3 diff --git a/include/seqan3/alphabet/nucleotide/dna3bs.hpp b/include/seqan3/alphabet/nucleotide/dna3bs.hpp index cad6635c92..91cde69c55 100644 --- a/include/seqan3/alphabet/nucleotide/dna3bs.hpp +++ b/include/seqan3/alphabet/nucleotide/dna3bs.hpp @@ -157,15 +157,20 @@ using dna3bs_vector = std::vector; // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ -/*!\name Literals +/*!\name Nucleotide literals * \{ */ - /*!\brief The seqan3::dna3bs char literal. - * \relates seqan3::dna3bs + * \relatesalso seqan3::dna3bs * \returns seqan3::dna3bs * \details + * + * You can use this char literal to assign a seqan3::dna3bs character: + * \include test/snippet/alphabet/nucleotide/dna3bs_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr dna3bs operator""_dna3bs(char const c) noexcept @@ -174,11 +179,10 @@ constexpr dna3bs operator""_dna3bs(char const c) noexcept } /*!\brief The seqan3::dna3bs string literal. - * \relates seqan3::dna3bs + * \relatesalso seqan3::dna3bs * \returns seqan3::dna3bs_vector * * You can use this string literal to easily assign to dna3bs_vector: - * * \include test/snippet/alphabet/nucleotide/dna3bs_literal.cpp * * \stableapi{Since version 3.1.} @@ -195,6 +199,8 @@ inline dna3bs_vector operator""_dna3bs(char const * s, std::size_t n) } //!\} +} // inline namespace literals + // ------------------------------------------------------------------ // dna3bs (deferred definition) // ------------------------------------------------------------------ diff --git a/include/seqan3/alphabet/nucleotide/dna4.hpp b/include/seqan3/alphabet/nucleotide/dna4.hpp index 57140e826e..c75638f4de 100644 --- a/include/seqan3/alphabet/nucleotide/dna4.hpp +++ b/include/seqan3/alphabet/nucleotide/dna4.hpp @@ -185,18 +185,25 @@ class dna4 : public nucleotide_base */ using dna4_vector = std::vector; +inline namespace literals +{ + // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ -/*!\name Literals +/*!\name Nucleotide literals * \{ */ /*!\brief The seqan3::dna4 char literal. - * \relates seqan3::dna4 + * \relatesalso seqan3::dna4 * \returns seqan3::dna4 * \details + * + * You can use this char literal to assign a seqan3::dna4 character: + * \include test/snippet/alphabet/nucleotide/dna4_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr dna4 operator""_dna4(char const c) noexcept @@ -205,11 +212,10 @@ constexpr dna4 operator""_dna4(char const c) noexcept } /*!\brief The seqan3::dna4 string literal. - * \relates seqan3::dna4 + * \relatesalso seqan3::dna4 * \returns seqan3::dna4_vector * * You can use this string literal to easily assign to dna4_vector: - * * \include test/snippet/alphabet/nucleotide/dna4_literal.cpp * * \stableapi{Since version 3.1.} @@ -226,6 +232,8 @@ inline dna4_vector operator""_dna4(char const * s, std::size_t n) } //!\} +} // inline namespace literals + // ------------------------------------------------------------------ // dna4 (deferred definition) // ------------------------------------------------------------------ diff --git a/include/seqan3/alphabet/nucleotide/dna5.hpp b/include/seqan3/alphabet/nucleotide/dna5.hpp index 9744084182..5764fdb17f 100644 --- a/include/seqan3/alphabet/nucleotide/dna5.hpp +++ b/include/seqan3/alphabet/nucleotide/dna5.hpp @@ -153,15 +153,20 @@ using dna5_vector = std::vector; // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ -/*!\name Literals +/*!\name Nucleotide literals * \{ */ - /*!\brief The seqan3::dna5 char literal. - * \relates seqan3::dna5 + * \relatesalso seqan3::dna5 * \returns seqan3::dna5 * \details + * + * You can use this char literal to assign a seqan3::dna4 character: + * \include test/snippet/alphabet/nucleotide/dna4_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr dna5 operator""_dna5(char const c) noexcept @@ -170,11 +175,10 @@ constexpr dna5 operator""_dna5(char const c) noexcept } /*!\brief The seqan3::dna5 string literal. - * \relates seqan3::dna5 + * \relatesalso seqan3::dna5 * \returns seqan3::dna5_vector * * You can use this string literal to easily assign to dna5_vector: - * * \include test/snippet/alphabet/nucleotide/dna5_literal.cpp * * \stableapi{Since version 3.1.} @@ -191,6 +195,8 @@ inline dna5_vector operator""_dna5(char const * s, std::size_t n) } //!\} +} // inline namespace literals + // ------------------------------------------------------------------ // dna5 (deferred definition) // ------------------------------------------------------------------ diff --git a/include/seqan3/alphabet/nucleotide/rna15.hpp b/include/seqan3/alphabet/nucleotide/rna15.hpp index 5be170003a..13d216044c 100644 --- a/include/seqan3/alphabet/nucleotide/rna15.hpp +++ b/include/seqan3/alphabet/nucleotide/rna15.hpp @@ -136,15 +136,20 @@ using rna15_vector = std::vector; // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ -/*!\name Literals +/*!\name Nucleotide literals * \{ */ - /*!\brief The seqan3::rna15 char literal. - * \relates seqan3::rna15 + * \relatesalso seqan3::rna15 * \returns seqan3::rna15 * \details + * + * You can use this char literal to assign a seqan3::rna15 character: + * \include test/snippet/alphabet/nucleotide/rna15_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr rna15 operator""_rna15(char const c) noexcept @@ -153,11 +158,10 @@ constexpr rna15 operator""_rna15(char const c) noexcept } /*!\brief The seqan3::rna15 string literal. - * \relates seqan3::rna15 + * \relatesalso seqan3::rna15 * \returns seqan3::rna15_vector * * You can use this string literal to easily assign to rna15_vector: - * * \include test/snippet/alphabet/nucleotide/rna15_literal.cpp * * \stableapi{Since version 3.1.} @@ -174,6 +178,8 @@ inline rna15_vector operator""_rna15(char const * s, std::size_t n) } //!\} +} // inline namespace literals + // ------------------------------------------------------------------ // rna15 (deferred definition) // ------------------------------------------------------------------ diff --git a/include/seqan3/alphabet/nucleotide/rna4.hpp b/include/seqan3/alphabet/nucleotide/rna4.hpp index 4ecf8083f5..a4ad698ffa 100644 --- a/include/seqan3/alphabet/nucleotide/rna4.hpp +++ b/include/seqan3/alphabet/nucleotide/rna4.hpp @@ -121,15 +121,20 @@ using rna4_vector = std::vector; // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ -/*!\name Literals +/*!\name Nucleotide literals * \{ */ - /*!\brief The seqan3::rna4 char literal. - * \relates seqan3::rna4 + * \relatesalso seqan3::rna4 * \returns seqan3::rna4 * \details + * + * You can use this char literal to assign a seqan3::rna4 character: + * \include test/snippet/alphabet/nucleotide/rna4_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr rna4 operator""_rna4(char const c) noexcept @@ -138,11 +143,10 @@ constexpr rna4 operator""_rna4(char const c) noexcept } /*!\brief The seqan3::rna4 string literal. - * \relates seqan3::rna4 + * \relatesalso seqan3::rna4 * \returns seqan3::rna4_vector * * You can use this string literal to easily assign to rna4_vector: - * * \include test/snippet/alphabet/nucleotide/rna4_literal.cpp * * \stableapi{Since version 3.1.} @@ -159,6 +163,8 @@ inline rna4_vector operator""_rna4(char const * s, std::size_t n) } //!\} +} // inline namespace literals + // ------------------------------------------------------------------ // rna4 (deferred definition) // ------------------------------------------------------------------ diff --git a/include/seqan3/alphabet/nucleotide/rna5.hpp b/include/seqan3/alphabet/nucleotide/rna5.hpp index de5f623713..2c70a527cf 100644 --- a/include/seqan3/alphabet/nucleotide/rna5.hpp +++ b/include/seqan3/alphabet/nucleotide/rna5.hpp @@ -121,18 +121,24 @@ class rna5 : public nucleotide_base */ using rna5_vector = std::vector; + // ------------------------------------------------------------------ // literals // ------------------------------------------------------------------ +inline namespace literals +{ -/*!\name Literals +/*!\name Nucleotide literals * \{ */ - /*!\brief The seqan3::rna5 char literal. - * \relates seqan3::rna5 + * \relatesalso seqan3::rna5 * \returns seqan3::rna5 * \details + * + * You can use this char literal to assign a seqan3::rna5 character: + * \include test/snippet/alphabet/nucleotide/rna5_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr rna5 operator""_rna5(char const c) noexcept @@ -141,11 +147,10 @@ constexpr rna5 operator""_rna5(char const c) noexcept } /*!\brief The seqan3::rna5 string literal. - * \relates seqan3::rna5 + * \relatesalso seqan3::rna5 * \returns seqan3::rna5_vector * * You can use this string literal to easily assign to rna5_vector: - * * \include test/snippet/alphabet/nucleotide/rna5_literal.cpp * * \stableapi{Since version 3.1.} @@ -162,6 +167,8 @@ inline rna5_vector operator""_rna5(char const * s, std::size_t n) } //!\} +} // inline namespace literals + // ------------------------------------------------------------------ // rna5 (deferred definition) // ------------------------------------------------------------------ diff --git a/include/seqan3/alphabet/quality/phred42.hpp b/include/seqan3/alphabet/quality/phred42.hpp index b71ec1f55d..abd342d89d 100644 --- a/include/seqan3/alphabet/quality/phred42.hpp +++ b/include/seqan3/alphabet/quality/phred42.hpp @@ -93,13 +93,20 @@ class phred42 : public phred_base //!\} }; -/*!\name Literals +inline namespace literals +{ + +/*!\name Quality literals * \{ */ /*!\brief The seqan3::phred42 char literal. - * \relates seqan3::phred42 + * \relatesalso seqan3::phred42 * \returns seqan3::phred42 * \details + * + * You can use this char literal to assign a seqan3::phred42 character: + * \include test/snippet/alphabet/quality/phred42_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr phred42 operator""_phred42(char const c) noexcept @@ -114,7 +121,6 @@ constexpr phred42 operator""_phred42(char const c) noexcept * \returns seqan3::std::vector * * You can use this string literal to easily assign to std::vector: - * * \include test/snippet/alphabet/quality/phred42_literal.cpp * * \stableapi{Since version 3.1.} @@ -131,4 +137,6 @@ inline std::vector operator""_phred42(char const * s, std::size_t n) } //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/quality/phred63.hpp b/include/seqan3/alphabet/quality/phred63.hpp index 86fb69bd94..1c38019b83 100644 --- a/include/seqan3/alphabet/quality/phred63.hpp +++ b/include/seqan3/alphabet/quality/phred63.hpp @@ -93,13 +93,20 @@ class phred63 : public phred_base //!\} }; -/*!\name Literals +inline namespace literals +{ + +/*!\name Quality literals * \{ */ /*!\brief The seqan3::phred63 char literal. - * \relates seqan3::phred63 + * \relatesalso seqan3::phred63 * \returns seqan3::phred63 * \details + * + * You can use this char literal to assign a seqan3::phred63 character: + * \include test/snippet/alphabet/quality/phred63_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr phred63 operator""_phred63(char const c) noexcept @@ -114,7 +121,6 @@ constexpr phred63 operator""_phred63(char const c) noexcept * \returns seqan3::std::vector * * You can use this string literal to easily assign to std::vector: - * * \include test/snippet/alphabet/quality/phred63_literal.cpp * * \stableapi{Since version 3.1.} @@ -131,4 +137,6 @@ inline std::vector operator""_phred63(char const * s, std::size_t n) } //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/quality/phred68solexa.hpp b/include/seqan3/alphabet/quality/phred68solexa.hpp index 64131884d8..0d3037aa7c 100644 --- a/include/seqan3/alphabet/quality/phred68solexa.hpp +++ b/include/seqan3/alphabet/quality/phred68solexa.hpp @@ -86,13 +86,23 @@ class phred68solexa : public phred_base //!\} }; -/*!\name Literals +//!\deprecated Please use seqan3::phred68solexa instead. +using phred68legacy SEQAN3_DEPRECATED_310 = seqan3::phred68solexa; + +inline namespace literals +{ + +/*!\name Quality literals * \{ */ /*!\brief The seqan3::phred68solexa char literal. - * \relates seqan3::phred68solexa + * \relatesalso seqan3::phred68solexa * \returns seqan3::phred68solexa * \details + * + * You can use this char literal to assign a seqan3::phred68solexa character: + * \include test/snippet/alphabet/quality/phred68solexa_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr phred68solexa operator""_phred68solexa(char const c) noexcept @@ -107,7 +117,6 @@ constexpr phred68solexa operator""_phred68solexa(char const c) noexcept * \returns seqan3::std::vector * * You can use this string literal to easily assign to std::vector: - * * \include test/snippet/alphabet/quality/phred68solexa_literal.cpp * * \stableapi{Since version 3.1.} @@ -122,14 +131,6 @@ inline std::vector operator""_phred68solexa(char const * s, std:: return r; } -//!\} - -} // namespace seqan3 - -namespace seqan3 -{ -//!\deprecated Please use seqan3::phred68solexa instead. -using phred68legacy SEQAN3_DEPRECATED_310 = seqan3::phred68solexa; //!\deprecated Please use seqan3::operator""_phred68solexa instead. SEQAN3_DEPRECATED_310 constexpr phred68solexa operator""_phred68legacy(char const c) noexcept @@ -142,4 +143,8 @@ SEQAN3_DEPRECATED_310 inline std::vector operator""_phred68legacy { return seqan3::operator""_phred68solexa(s, n); } +//!\} + +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/quality/phred94.hpp b/include/seqan3/alphabet/quality/phred94.hpp index fb51d5859f..04e1c77015 100644 --- a/include/seqan3/alphabet/quality/phred94.hpp +++ b/include/seqan3/alphabet/quality/phred94.hpp @@ -90,13 +90,20 @@ class phred94 : public phred_base //!\} }; -/*!\name Literals +inline namespace literals +{ + +/*!\name Quality literals * \{ */ /*!\brief The seqan3::phred94 char literal. - * \relates seqan3::phred94 + * \relatesalso seqan3::phred94 * \returns seqan3::phred94 * \details + * + * You can use this char literal to assign a seqan3::phred94 character: + * \include test/snippet/alphabet/quality/phred94_char_literal.cpp + * * \stableapi{Since version 3.1.} */ constexpr phred94 operator""_phred94(char const c) noexcept @@ -111,9 +118,8 @@ constexpr phred94 operator""_phred94(char const c) noexcept * \returns seqan3::std::vector * * You can use this string literal to easily assign to std::vector: - * * \include test/snippet/alphabet/quality/phred94_literal.cpp - * \details + * * \stableapi{Since version 3.1.} */ inline std::vector operator""_phred94(char const * s, std::size_t n) @@ -128,4 +134,6 @@ inline std::vector operator""_phred94(char const * s, std::size_t n) } //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/structure/dot_bracket3.hpp b/include/seqan3/alphabet/structure/dot_bracket3.hpp index 5955bfc4b3..49fdbc68c1 100644 --- a/include/seqan3/alphabet/structure/dot_bracket3.hpp +++ b/include/seqan3/alphabet/structure/dot_bracket3.hpp @@ -44,9 +44,9 @@ namespace seqan3 * (((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). *``` * - * ### Usage - * The following code example creates a dot_bracket3 vector, modifies it, and prints the result to stderr. - * \include test/snippet/alphabet/structure/dot_bracket3_general.cpp + * ### Example + * + * \include test/snippet/alphabet/structure/dot_bracket3.cpp * * \experimentalapi{Experimental since version 3.1.} */ @@ -171,16 +171,34 @@ class dot_bracket3 : public alphabet_base } }; -/*!\name Literals +inline namespace literals +{ + +/*!\name Structure literals * \{ */ +/*!\brief The seqan3::db3 char literal. + * \relatesalso seqan3::dot_bracket3 + * \param[in] ch The character to represent as dot bracket. + * \returns seqan3::dot_bracket3 + * + * You can use this char literal to assign a seqan3::dot_bracket3 character: + * \include test/snippet/alphabet/structure/dot_bracket3_char_literal.cpp + * + * \experimentalapi{Experimental since version 3.1.} + */ +constexpr dot_bracket3 operator""_db3(char const ch) noexcept +{ + return dot_bracket3{}.assign_char(ch); +} + /*!\brief The seqan3::db3 string literal. - * \relates seqan3::dot_bracket3 + * \relatesalso seqan3::dot_bracket3 * \param[in] str A pointer to the character string to assign. * \param[in] len The size of the character string to assign. * \returns std::vector * - * You can use this string literal to easily assign to a vector of seqan3::dot_bracket3 characters: + * You can use this string literal to easily assign to std::vector: * \include test/snippet/alphabet/structure/dot_bracket3_literal.cpp * * \experimentalapi{Experimental since version 3.1.} @@ -195,22 +213,8 @@ inline std::vector operator""_db3(const char * str, std::size_t le return vec; } - -/*!\brief The seqan3::db3 char literal. - * \relates seqan3::dot_bracket3 - * \param[in] ch The character to represent as dot bracket. - * \returns seqan3::dot_bracket3 - * - * You can use this string literal to assign a seqan3::dot_bracket3 character: - * \include test/snippet/alphabet/structure/dot_bracket3_char_literal.cpp - * - * \experimentalapi{Experimental since version 3.1.} - */ -constexpr dot_bracket3 operator""_db3(char const ch) noexcept -{ - return dot_bracket3{}.assign_char(ch); -} - //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/structure/dssp9.hpp b/include/seqan3/alphabet/structure/dssp9.hpp index 82fbfd9258..eaf205524d 100644 --- a/include/seqan3/alphabet/structure/dssp9.hpp +++ b/include/seqan3/alphabet/structure/dssp9.hpp @@ -53,9 +53,9 @@ namespace seqan3 * C = coil/loop * X = unknown * - * ### Usage - * The following code example creates a dssp9 vector, modifies it, and prints the result to stderr. - * \include test/snippet/alphabet/structure/dssp9_general.cpp + * ### Example + * + * \include test/snippet/alphabet/structure/dssp9.cpp * * \experimentalapi{Experimental since version 3.1.} */ @@ -123,16 +123,34 @@ class dssp9 : public alphabet_base } }; -/*!\name Literals +inline namespace literals +{ + +/*!\name Structure literals * \{ */ +/*!\brief The seqan3::dssp9 char literal. + * \relatesalso seqan3::dssp9 + * \param[in] ch The character to represent as dssp. + * \returns seqan3::dssp9 + * + * You can use this char literal to assign a seqan3::dssp9 character: + * \include test/snippet/alphabet/structure/dssp9_char_literal.cpp + * + * \experimentalapi{Experimental since version 3.1.} + */ +constexpr dssp9 operator""_dssp9(char const ch) noexcept +{ + return dssp9{}.assign_char(ch); +} + /*!\brief The seqan3::dssp9 string literal. - * \relates seqan3::dssp9 + * \relatesalso seqan3::dssp9 * \param[in] str A pointer to the character string to assign. * \param[in] len The size of the character string to assign. * \returns std::vector * - * You can use this string literal to easily assign to a vector of seqan3::dssp9 characters: + * You can use this string literal to easily assign to std::vector: * \include test/snippet/alphabet/structure/dssp9_literal.cpp * * \experimentalapi{Experimental since version 3.1.} @@ -147,22 +165,8 @@ inline std::vector operator""_dssp9(const char * str, std::size_t len) return vec; } - -/*!\brief The seqan3::dssp9 char literal. - * \relates seqan3::dssp9 - * \param[in] ch The character to represent as dssp. - * \returns seqan3::dssp9 - * - * You can use this string literal to assign a seqan3::dssp9 character: - * \include test/snippet/alphabet/structure/dssp9_char_literal.cpp - * - * \experimentalapi{Experimental since version 3.1.} - */ -constexpr dssp9 operator""_dssp9(char const ch) noexcept -{ - return dssp9{}.assign_char(ch); -} - //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/alphabet/structure/wuss.hpp b/include/seqan3/alphabet/structure/wuss.hpp index fffe656fc0..b8ef20050f 100644 --- a/include/seqan3/alphabet/structure/wuss.hpp +++ b/include/seqan3/alphabet/structure/wuss.hpp @@ -49,9 +49,9 @@ namespace seqan3 * <<<<_AAAA____>>>>aaaa *``` * - * ### Usage - * The following code example creates a wuss vector, modifies it, and prints the result to stderr. - * \include test/snippet/alphabet/structure/wuss_general.cpp + * ### Example + * + * \include test/snippet/alphabet/structure/wuss.cpp * * \experimentalapi{Experimental since version 3.1.} */ @@ -243,17 +243,34 @@ constexpr std::array wuss::interaction_tab = [] () constexpr */ using wuss51 = wuss<51>; -/*!\name Literals +inline namespace literals +{ + +/*!\name Structure literals * \{ */ +/*!\brief The seqan3::wuss51 char literal. + * \relatesalso seqan3::wuss + * \param[in] ch The character to represent as wuss. + * \returns seqan3::wuss51 + * + * You can use this char literal to assign a seqan3::wuss51 character: + * \include test/snippet/alphabet/structure/wuss_char_literal.cpp + * + * \experimentalapi{Experimental since version 3.1.} + */ +constexpr wuss51 operator""_wuss51(char const ch) noexcept +{ + return wuss51{}.assign_char(ch); +} /*!\brief The seqan3::wuss51 string literal. - * \relates seqan3::wuss + * \relatesalso seqan3::wuss * \param[in] str A pointer to the character string to assign. * \param[in] len The size of the character string to assign. * \returns std::vector * - * You can use this string literal to easily assign to a vector of seqan3::wuss51 characters: + * You can use this string literal to easily assign to std::vector: * \include test/snippet/alphabet/structure/wuss_literal.cpp * * \experimentalapi{Experimental since version 3.1.} @@ -268,23 +285,8 @@ inline std::vector operator""_wuss51(const char * str, std::size_t len) return vec; } - -/*!\brief The seqan3::wuss51 char literal. - * \relates seqan3::wuss - * \param[in] ch The character to represent as wuss. - * \returns seqan3::wuss51 - * - * You can use this string literal to assign a seqan3::wuss51 character. - * For different wuss alphabet sizes the `assign_char` function must be used. - * \include test/snippet/alphabet/structure/wuss_char_literal.cpp - * - * \experimentalapi{Experimental since version 3.1.} - */ -constexpr wuss51 operator""_wuss51(char const ch) noexcept -{ - return wuss51{}.assign_char(ch); -} - //!\} +} // inline namespace literals + } // namespace seqan3 diff --git a/include/seqan3/io/sam_file/sam_tag_dictionary.hpp b/include/seqan3/io/sam_file/sam_tag_dictionary.hpp index 4a205267a9..df5a810d46 100644 --- a/include/seqan3/io/sam_file/sam_tag_dictionary.hpp +++ b/include/seqan3/io/sam_file/sam_tag_dictionary.hpp @@ -41,24 +41,27 @@ namespace seqan3::detail namespace seqan3 { +inline namespace literals +{ + +/*!\name Other literals + * \{ + */ /*!\brief The SAM tag literal, such that tags can be used in constant expressions. * \ingroup io_sam_file - * \tparam char_t The char type. Usually `char`. Parameter pack `...s` must be of - * length 2, since SAM tags consist of two letters (char0 and char1). + * \tparam char_t The char type. Usually `char`. Parameter pack `...s` must be of length 2 since SAM tags consist of two + * letters (char0 and char1). + * \relatesalso seqan3::sam_tag_dictionary * \returns The unique identifier of the SAM tag computed by char0 * 128 + char1. * * \details * - * A SAM tag consists of two letters, initialized via the string literal ""_tag, - * which delegate to its unique id. - * e.g. + * A SAM tag consists of two letters, initialized via the string literal ""_tag, which delegate to its unique id. * * \snippet test/snippet/io/sam_file/sam_tag_dictionary/sam_tag_dictionary.cpp tag * - * The purpose of those tags is to fill or query the seqan3::sam_tag_dictionary - * for a specific key (tag_id) and retrieve the corresponding value. - * - * \sa seqan3::sam_tag_dictionary + * The purpose of those tags is to fill or query the seqan3::sam_tag_dictionary for a specific key (tag_id) and + * retrieve the corresponding value. */ #ifdef __cpp_nontype_template_parameter_class @@ -86,6 +89,9 @@ constexpr uint16_t operator""_tag() return static_cast(char0) * 256 + static_cast(char1); } +//!\} + +} // inline namespace literals /*!\brief The generic base class. * \ingroup io_sam_file diff --git a/include/seqan3/search/kmer_index/shape.hpp b/include/seqan3/search/kmer_index/shape.hpp index 1e1866a93a..c7fefa2f5f 100644 --- a/include/seqan3/search/kmer_index/shape.hpp +++ b/include/seqan3/search/kmer_index/shape.hpp @@ -110,14 +110,23 @@ class shape : public dynamic_bitset<58> //!\} }; +inline namespace literals +{ + +/*!\name Other literals + * \{ + */ /*!\brief The seqan3::shape literal. * \param[in] value The unsigned integer to assign. - * \relates seqan3::shape + * \relatesalso seqan3::shape * \returns seqan3::shape */ constexpr shape operator""_shape(unsigned long long const value) { return shape{bin_literal{value}}; } +//!\} + +} // inline namespace literals }// namespace seqan3 diff --git a/test/snippet/alignment/configuration/align_cfg_method_local.cpp b/test/snippet/alignment/configuration/align_cfg_method_local.cpp index 0ebad6e647..6d1fa1c467 100644 --- a/test/snippet/alignment/configuration/align_cfg_method_local.cpp +++ b/test/snippet/alignment/configuration/align_cfg_method_local.cpp @@ -5,7 +5,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/alignment/configuration/align_cfg_output_examples.cpp b/test/snippet/alignment/configuration/align_cfg_output_examples.cpp index b523948e19..710fbfd472 100644 --- a/test/snippet/alignment/configuration/align_cfg_output_examples.cpp +++ b/test/snippet/alignment/configuration/align_cfg_output_examples.cpp @@ -7,7 +7,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; // Basic alignment algorithm configuration. auto config = seqan3::align_cfg::method_global{} | seqan3::align_cfg::edit_scheme; diff --git a/test/snippet/alignment/configuration/minimal_alignment_config.cpp b/test/snippet/alignment/configuration/minimal_alignment_config.cpp index 041fe7ec76..37712487d7 100644 --- a/test/snippet/alignment/configuration/minimal_alignment_config.cpp +++ b/test/snippet/alignment/configuration/minimal_alignment_config.cpp @@ -5,7 +5,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/alignment/matrix/debug_matrix_score.cpp b/test/snippet/alignment/matrix/debug_matrix_score.cpp index 06d124c86b..c628c7c94d 100644 --- a/test/snippet/alignment/matrix/debug_matrix_score.cpp +++ b/test/snippet/alignment/matrix/debug_matrix_score.cpp @@ -7,7 +7,7 @@ int main() { using seqan3::detail::debug_matrix; - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector database = "AACCGGTT"_dna4; std::vector query = "ACGT"_dna4; diff --git a/test/snippet/alignment/matrix/debug_matrix_trace.cpp b/test/snippet/alignment/matrix/debug_matrix_trace.cpp index c43daba199..3026f9e3a5 100644 --- a/test/snippet/alignment/matrix/debug_matrix_trace.cpp +++ b/test/snippet/alignment/matrix/debug_matrix_trace.cpp @@ -8,7 +8,7 @@ int main() { using seqan3::detail::debug_matrix; - using seqan3::operator""_dna4; + using namespace seqan3::literals; using seqan3::operator|; std::vector database = "AACCGGTT"_dna4; diff --git a/test/snippet/alignment/pairwise/align_pairwise.cpp b/test/snippet/alignment/pairwise/align_pairwise.cpp index bb57c2d210..3cb91ab7d0 100644 --- a/test/snippet/alignment/pairwise/align_pairwise.cpp +++ b/test/snippet/alignment/pairwise/align_pairwise.cpp @@ -8,7 +8,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; //![start] // Configure the alignment kernel. diff --git a/test/snippet/alignment/pairwise/align_pairwise_range.cpp b/test/snippet/alignment/pairwise/align_pairwise_range.cpp index baa3763576..6944b9a326 100644 --- a/test/snippet/alignment/pairwise/align_pairwise_range.cpp +++ b/test/snippet/alignment/pairwise/align_pairwise_range.cpp @@ -8,7 +8,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector data1{"AGTGCTACG"_dna4, "AGTAGACTACG"_dna4, "AGTTACGAC"_dna4}; std::vector data2{"ACGTGCGACTAG"_dna4, "ACGTACGACACG"_dna4, "AGTAGCGATCG"_dna4}; diff --git a/test/snippet/alignment/pairwise/parallel_align_pairwise_with_callback.cpp b/test/snippet/alignment/pairwise/parallel_align_pairwise_with_callback.cpp index 9c7ed0df76..edc5e93fb3 100644 --- a/test/snippet/alignment/pairwise/parallel_align_pairwise_with_callback.cpp +++ b/test/snippet/alignment/pairwise/parallel_align_pairwise_with_callback.cpp @@ -9,7 +9,7 @@ int main() { // Generate some sequences. - using seqan3::operator""_dna4; + using namespace seqan3::literals; using sequence_pair_t = std::pair; std::vector sequences{100, {"AGTGCTACG"_dna4, "ACGTGCGACTAG"_dna4}}; diff --git a/test/snippet/alignment/scoring/aminoacid_scoring_scheme.cpp b/test/snippet/alignment/scoring/aminoacid_scoring_scheme.cpp index 9018c3500c..05166af4a0 100644 --- a/test/snippet/alignment/scoring/aminoacid_scoring_scheme.cpp +++ b/test/snippet/alignment/scoring/aminoacid_scoring_scheme.cpp @@ -8,8 +8,7 @@ int main() { -using seqan3::operator""_aa27; -using seqan3::operator""_aa20; +using namespace seqan3::literals; seqan3::aminoacid_scoring_scheme scheme{seqan3::aminoacid_similarity_matrix::BLOSUM62}; // How to score two letters: diff --git a/test/snippet/alignment/scoring/nucleotide_scoring_scheme.cpp b/test/snippet/alignment/scoring/nucleotide_scoring_scheme.cpp index fb0ea82985..188c2c43ba 100644 --- a/test/snippet/alignment/scoring/nucleotide_scoring_scheme.cpp +++ b/test/snippet/alignment/scoring/nucleotide_scoring_scheme.cpp @@ -8,9 +8,7 @@ int main() { -using seqan3::operator""_dna5; -using seqan3::operator""_dna15; -using seqan3::operator""_rna15; +using namespace seqan3::literals; // You can score two letters: seqan3::nucleotide_scoring_scheme scheme; // hamming is default diff --git a/test/snippet/alphabet/all_literal.cpp b/test/snippet/alphabet/all_literal.cpp index 2abc97c7b2..b7023140d5 100644 --- a/test/snippet/alphabet/all_literal.cpp +++ b/test/snippet/alphabet/all_literal.cpp @@ -2,7 +2,8 @@ int main() { - using seqan3::operator""_dna4; - seqan3::dna4 my_letter = 'A'_dna4; // identical to assign_char_to('A', my_letter); - seqan3::dna4_vector my_seq = "ACGT"_dna4; // identical to calling assign_char for each element + using namespace seqan3::literals; + + seqan3::dna4 letter = 'A'_dna4; // identical to assign_char_to('A', letter); + seqan3::dna4_vector sequence = "ACGT"_dna4; // identical to calling assign_char for each element } diff --git a/test/snippet/alphabet/aminoacid/aa10li.cpp b/test/snippet/alphabet/aminoacid/aa10li.cpp index 408fbc5b57..8537114e56 100644 --- a/test/snippet/alphabet/aminoacid/aa10li.cpp +++ b/test/snippet/alphabet/aminoacid/aa10li.cpp @@ -1,25 +1,15 @@ #include -#include #include -using seqan3::operator""_aa10li; -using seqan3::operator""_aa27; - int main() { - // Construction of aa10li amino acids from character - seqan3::aa10li my_letter{'A'_aa10li}; - - my_letter.assign_char('C'); - my_letter.assign_char('?'); // all unknown characters are converted to 'A'_aa10li implicitly - - seqan3::debug_stream << my_letter.to_char() << '\n'; // A + using namespace seqan3::literals; - // Convert aa27 alphabet to aa10_murphy - seqan3::aa27_vector v1{"ALRSTXOUMP"_aa27}; - auto v2 = v1 | std::views::transform([] (auto const & in) { return static_cast(in); }); + seqan3::aa10li letter{'A'_aa10li}; - seqan3::debug_stream << v2 << '\n'; // AJKAASKCJP + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" - return 0; + letter.assign_char('?'); // Unknown characters are implicitly converted to A. + seqan3::debug_stream << letter << '\n'; // prints "A" } diff --git a/test/snippet/alphabet/aminoacid/aa10li_char_literal.cpp b/test/snippet/alphabet/aminoacid/aa10li_char_literal.cpp new file mode 100644 index 0000000000..65dda387e1 --- /dev/null +++ b/test/snippet/alphabet/aminoacid/aa10li_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::aa10li letter1{'A'_aa10li}; + auto letter2 = 'A'_aa10li; +} diff --git a/test/snippet/alphabet/aminoacid/aa10li_literal.cpp b/test/snippet/alphabet/aminoacid/aa10li_literal.cpp new file mode 100644 index 0000000000..4d525ca187 --- /dev/null +++ b/test/snippet/alphabet/aminoacid/aa10li_literal.cpp @@ -0,0 +1,10 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::aa10li_vector sequence1{"ACGTTA"_aa10li}; + seqan3::aa10li_vector sequence2 = "ACGTTA"_aa10li; + auto sequence3 = "ACGTTA"_aa10li; +} diff --git a/test/snippet/alphabet/aminoacid/aa10murphy.cpp b/test/snippet/alphabet/aminoacid/aa10murphy.cpp index 87e8a51604..ed5cba03a4 100644 --- a/test/snippet/alphabet/aminoacid/aa10murphy.cpp +++ b/test/snippet/alphabet/aminoacid/aa10murphy.cpp @@ -1,25 +1,15 @@ #include -#include #include -using seqan3::operator""_aa10murphy; -using seqan3::operator""_aa27; - int main() { - // Construction of aa10murphy amino acids from character - seqan3::aa10murphy my_letter{'A'_aa10murphy}; - - my_letter.assign_char('C'); - my_letter.assign_char('?'); // all unknown characters are converted to 'S'_aa10murphy implicitly - - seqan3::debug_stream << my_letter.to_char() << '\n'; // S + using namespace seqan3::literals; - // Convert aa27 alphabet to aa10_murphy - seqan3::aa27_vector v1{"AVRSTXOUB"_aa27}; - auto v2 = v1 | std::views::transform([] (auto const & in) { return static_cast(in); }); + seqan3::aa10murphy letter{'A'_aa10murphy}; - seqan3::debug_stream << v2 << '\n'; // AIKSSSKCB + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" - return 0; + letter.assign_char('?'); // Unknown characters are implicitly converted to S. + seqan3::debug_stream << letter << '\n'; // prints "S" } diff --git a/test/snippet/alphabet/aminoacid/aa10murphy_char_literal.cpp b/test/snippet/alphabet/aminoacid/aa10murphy_char_literal.cpp new file mode 100644 index 0000000000..ef327b0c90 --- /dev/null +++ b/test/snippet/alphabet/aminoacid/aa10murphy_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::aa10murphy letter1{'A'_aa10murphy}; + auto letter2 = 'A'_aa10murphy; +} diff --git a/test/snippet/alphabet/aminoacid/aa10murphy_literal.cpp b/test/snippet/alphabet/aminoacid/aa10murphy_literal.cpp new file mode 100644 index 0000000000..6994f72ea0 --- /dev/null +++ b/test/snippet/alphabet/aminoacid/aa10murphy_literal.cpp @@ -0,0 +1,10 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::aa10murphy_vector sequence1{"ACGTTA"_aa10murphy}; + seqan3::aa10murphy_vector sequence2 = "ACGTTA"_aa10murphy; + auto sequence3 = "ACGTTA"_aa10murphy; +} diff --git a/test/snippet/alphabet/aminoacid/aa20.cpp b/test/snippet/alphabet/aminoacid/aa20.cpp new file mode 100644 index 0000000000..a46b044fe1 --- /dev/null +++ b/test/snippet/alphabet/aminoacid/aa20.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::aa20 letter{'A'_aa20}; + + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" + + letter.assign_char('?'); // Unknown characters are implicitly converted to S. + seqan3::debug_stream << letter << '\n'; // prints "S" +} diff --git a/test/snippet/alphabet/aminoacid/aa20_char_literal.cpp b/test/snippet/alphabet/aminoacid/aa20_char_literal.cpp index 1f40d312c7..3d182d2096 100644 --- a/test/snippet/alphabet/aminoacid/aa20_char_literal.cpp +++ b/test/snippet/alphabet/aminoacid/aa20_char_literal.cpp @@ -2,9 +2,8 @@ int main() { - using seqan3::operator""_aa20; + using namespace seqan3::literals; - seqan3::aa20 acid1{'A'_aa20}; - - auto acid2 = 'Y'_aa20; // type = aa20 + seqan3::aa20 letter1{'A'_aa20}; + auto letter2 = 'A'_aa20; } diff --git a/test/snippet/alphabet/aminoacid/aa20_construction.cpp b/test/snippet/alphabet/aminoacid/aa20_construction.cpp deleted file mode 100644 index 3e17ac074b..0000000000 --- a/test/snippet/alphabet/aminoacid/aa20_construction.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -int main() -{ - using seqan3::operator""_aa20; - - seqan3::aa20 my_letter{'A'_aa20}; - - my_letter.assign_char('C'); - - my_letter.assign_char('?'); // all unknown characters are converted to 'A'_aa20 implicitly - - if (my_letter.to_char() == 'A') - seqan3::debug_stream << "yeah\n"; // "yeah"; -} diff --git a/test/snippet/alphabet/aminoacid/aa20_literal.cpp b/test/snippet/alphabet/aminoacid/aa20_literal.cpp index 07572d9e6e..cf9a77ba55 100644 --- a/test/snippet/alphabet/aminoacid/aa20_literal.cpp +++ b/test/snippet/alphabet/aminoacid/aa20_literal.cpp @@ -2,9 +2,9 @@ int main() { - using seqan3::operator""_aa20; - - seqan3::aa20_vector foo{"ABFUYR"_aa20}; - seqan3::aa20_vector bar = "ABFUYR"_aa20; - auto bax = "ABFUYR"_aa20; + using namespace seqan3::literals; + + seqan3::aa20_vector sequence1{"ACGTTA"_aa20}; + seqan3::aa20_vector sequence2 = "ACGTTA"_aa20; + auto sequence3 = "ACGTTA"_aa20; } diff --git a/test/snippet/alphabet/aminoacid/aa27.cpp b/test/snippet/alphabet/aminoacid/aa27.cpp new file mode 100644 index 0000000000..ab57d484bb --- /dev/null +++ b/test/snippet/alphabet/aminoacid/aa27.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::aa27 letter{'A'_aa27}; + + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" + + letter.assign_char('?'); // Unknown characters are implicitly converted to X. + seqan3::debug_stream << letter << '\n'; // prints "X" +} diff --git a/test/snippet/alphabet/aminoacid/aa27_char_literal.cpp b/test/snippet/alphabet/aminoacid/aa27_char_literal.cpp index 03f618c0da..85cd374467 100644 --- a/test/snippet/alphabet/aminoacid/aa27_char_literal.cpp +++ b/test/snippet/alphabet/aminoacid/aa27_char_literal.cpp @@ -2,9 +2,8 @@ int main() { - using seqan3::operator""_aa27; + using namespace seqan3::literals; - seqan3::aa27 acid1{'A'_aa27}; - - auto acid2 = 'Y'_aa27; // type = aa27 + seqan3::aa27 letter1{'A'_aa27}; + auto letter2 = 'A'_aa27; } diff --git a/test/snippet/alphabet/aminoacid/aa27_construction.cpp b/test/snippet/alphabet/aminoacid/aa27_construction.cpp deleted file mode 100644 index 32f838592e..0000000000 --- a/test/snippet/alphabet/aminoacid/aa27_construction.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -int main() -{ - using seqan3::operator""_aa27; - - seqan3::aa27 my_letter{'A'_aa27}; - - my_letter.assign_char('C'); - - my_letter.assign_char('?'); // all unknown characters are converted to 'X'_aa27 implicitly - if (my_letter.to_char() == 'X') - seqan3::debug_stream << "yeah\n"; // "yeah"; -} diff --git a/test/snippet/alphabet/aminoacid/aa27_literal.cpp b/test/snippet/alphabet/aminoacid/aa27_literal.cpp index a2fdc4e9f6..b52c1a9f28 100644 --- a/test/snippet/alphabet/aminoacid/aa27_literal.cpp +++ b/test/snippet/alphabet/aminoacid/aa27_literal.cpp @@ -2,9 +2,9 @@ int main() { - using seqan3::operator""_aa27; - - seqan3::aa27_vector foo{"ABFUYR"_aa27}; - seqan3::aa27_vector bar = "ABFUYR"_aa27; - auto bax = "ABFUYR"_aa27; + using namespace seqan3::literals; + + seqan3::aa27_vector sequence1{"ACGTTA"_aa27}; + seqan3::aa27_vector sequence2 = "ACGTTA"_aa27; + auto sequence3 = "ACGTTA"_aa27; } diff --git a/test/snippet/alphabet/cigar/cigar.cpp b/test/snippet/alphabet/cigar/cigar.cpp index f8efdf6f6d..26bc6671d8 100644 --- a/test/snippet/alphabet/cigar/cigar.cpp +++ b/test/snippet/alphabet/cigar/cigar.cpp @@ -1,13 +1,15 @@ #include #include -using seqan3::operator""_cigar_operation; - int main() { - seqan3::cigar c{13, 'M'_cigar_operation}; - seqan3::debug_stream << c << '\n'; // "13M" + using namespace seqan3::literals; + + seqan3::cigar letter{12, 'M'_cigar_operation}; + + letter.assign_string("10D"); + seqan3::debug_stream << letter << '\n'; // prints "10D" - c.assign_string("14X"); - seqan3::debug_stream << c << '\n'; // "14X" + letter.assign_string("20Z"); // Unknown strings are implicitly converted to 0P. + seqan3::debug_stream << letter << '\n'; // prints "0P" } diff --git a/test/snippet/alphabet/cigar/cigar_get_index.cpp b/test/snippet/alphabet/cigar/cigar_get_index.cpp index aaac0dba63..c9182b3ed8 100644 --- a/test/snippet/alphabet/cigar/cigar_get_index.cpp +++ b/test/snippet/alphabet/cigar/cigar_get_index.cpp @@ -4,7 +4,7 @@ int main() { using seqan3::get; - using seqan3::operator""_cigar_operation; + using namespace seqan3::literals; seqan3::cigar letter{10, 'M'_cigar_operation}; diff --git a/test/snippet/alphabet/cigar/cigar_get_type.cpp b/test/snippet/alphabet/cigar/cigar_get_type.cpp index 3f8ac06de9..22aea601ff 100644 --- a/test/snippet/alphabet/cigar/cigar_get_type.cpp +++ b/test/snippet/alphabet/cigar/cigar_get_type.cpp @@ -4,7 +4,7 @@ int main() { using seqan3::get; - using seqan3::operator""_cigar_operation; + using namespace seqan3::literals; seqan3::cigar letter{10, 'M'_cigar_operation}; diff --git a/test/snippet/alphabet/cigar/cigar_op.cpp b/test/snippet/alphabet/cigar/cigar_op.cpp deleted file mode 100644 index e91db7741e..0000000000 --- a/test/snippet/alphabet/cigar/cigar_op.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -using seqan3::operator""_cigar_operation; - -int main() -{ - // Initialise a seqan3::cigar::operation: - seqan3::cigar::operation match{'M'_cigar_operation}; - - // you can print cigar_op values: - seqan3::debug_stream << match << '\n'; // M -} diff --git a/test/snippet/alphabet/cigar/cigar_operation.cpp b/test/snippet/alphabet/cigar/cigar_operation.cpp new file mode 100644 index 0000000000..44ef5a94a7 --- /dev/null +++ b/test/snippet/alphabet/cigar/cigar_operation.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::cigar::operation letter{'M'_cigar_operation}; + + letter.assign_char('D'); + seqan3::debug_stream << letter << '\n'; // prints "D" + + letter.assign_char('Z'); // Unknown characters are implicitly converted to M. + seqan3::debug_stream << letter << '\n'; // prints "M" +} diff --git a/test/snippet/alphabet/cigar/cigar_operation_char_literal.cpp b/test/snippet/alphabet/cigar/cigar_operation_char_literal.cpp new file mode 100644 index 0000000000..a54fe05d7f --- /dev/null +++ b/test/snippet/alphabet/cigar/cigar_operation_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::cigar::operation letter1{'M'_cigar_operation}; + auto letter2 = 'M'_cigar_operation; +} diff --git a/test/snippet/alphabet/cigar/cigar_value_assignment.cpp b/test/snippet/alphabet/cigar/cigar_value_assignment.cpp index 23d369bffb..d61a1601fc 100644 --- a/test/snippet/alphabet/cigar/cigar_value_assignment.cpp +++ b/test/snippet/alphabet/cigar/cigar_value_assignment.cpp @@ -3,7 +3,7 @@ int main() { - using seqan3::operator""_cigar_operation; + using namespace seqan3::literals; seqan3::cigar letter{10, 'I'_cigar_operation}; seqan3::debug_stream << "letter: " << letter << '\n'; // 10I diff --git a/test/snippet/alphabet/cigar/cigar_value_construction.cpp b/test/snippet/alphabet/cigar/cigar_value_construction.cpp index 34c077f7da..ad91a3101e 100644 --- a/test/snippet/alphabet/cigar/cigar_value_construction.cpp +++ b/test/snippet/alphabet/cigar/cigar_value_construction.cpp @@ -3,7 +3,7 @@ int main() { - using seqan3::operator""_cigar_operation; + using namespace seqan3::literals; // creates 10M, as the cigar_op field is not provided. seqan3::cigar letter1{10}; diff --git a/test/snippet/alphabet/composite/alphabet_tuple_base_subtype_assignment.cpp b/test/snippet/alphabet/composite/alphabet_tuple_base_subtype_assignment.cpp index 7bbfd43bb0..7b798eb321 100644 --- a/test/snippet/alphabet/composite/alphabet_tuple_base_subtype_assignment.cpp +++ b/test/snippet/alphabet/composite/alphabet_tuple_base_subtype_assignment.cpp @@ -4,9 +4,7 @@ int main() { - using seqan3::operator""_dna4; - using seqan3::operator""_phred42; - using seqan3::operator""_rna4; + using namespace seqan3::literals; seqan3::qualified letter1{'T'_dna4, '"'_phred42}; diff --git a/test/snippet/alphabet/composite/alphabet_tuple_base_subtype_construction.cpp b/test/snippet/alphabet/composite/alphabet_tuple_base_subtype_construction.cpp index b1eb436866..8caf9c0217 100644 --- a/test/snippet/alphabet/composite/alphabet_tuple_base_subtype_construction.cpp +++ b/test/snippet/alphabet/composite/alphabet_tuple_base_subtype_construction.cpp @@ -5,9 +5,7 @@ int main() { - using seqan3::operator""_dna4; - using seqan3::operator""_rna4; - // using seqan3::operator""_phred42; + using namespace seqan3::literals; // The following creates {'C'_dna4, '!'_phred42} seqan3::qualified letter1{'C'_dna4}; diff --git a/test/snippet/alphabet/composite/alphabet_tuple_base_value_assignment.cpp b/test/snippet/alphabet/composite/alphabet_tuple_base_value_assignment.cpp index eb2334b451..0a31ba24ed 100644 --- a/test/snippet/alphabet/composite/alphabet_tuple_base_value_assignment.cpp +++ b/test/snippet/alphabet/composite/alphabet_tuple_base_value_assignment.cpp @@ -4,8 +4,7 @@ int main() { - using seqan3::operator""_dna4; - using seqan3::operator""_phred42; + using namespace seqan3::literals; seqan3::qualified letter1{'T'_dna4, '"'_phred42}; diff --git a/test/snippet/alphabet/composite/alphabet_tuple_base_value_construction.cpp b/test/snippet/alphabet/composite/alphabet_tuple_base_value_construction.cpp index c0d3ad35cf..8d88ec25e3 100644 --- a/test/snippet/alphabet/composite/alphabet_tuple_base_value_construction.cpp +++ b/test/snippet/alphabet/composite/alphabet_tuple_base_value_construction.cpp @@ -5,8 +5,7 @@ int main() { - using seqan3::operator""_dna4; - using seqan3::operator""_phred42; + using namespace seqan3::literals; seqan3::qualified letter1{'C'_dna4}; // creates {'C'_dna4, '!'_phred42} seqan3::qualified letter2{'"'_phred42}; // creates {'A'_dna4, '"'_phred42} diff --git a/test/snippet/alphabet/composite/alphabet_variant.cpp b/test/snippet/alphabet/composite/alphabet_variant.cpp index 9d1d96db6e..1ab25c90d1 100644 --- a/test/snippet/alphabet/composite/alphabet_variant.cpp +++ b/test/snippet/alphabet/composite/alphabet_variant.cpp @@ -4,8 +4,7 @@ int main() { - using seqan3::operator""_dna5; - using seqan3::operator""_rna5; + using namespace seqan3::literals; seqan3::alphabet_variant letter{}; // implicitly 'A'_dna5 seqan3::alphabet_variant letter2{'C'_dna5}; // constructed from alternative (== 'C'_dna5) diff --git a/test/snippet/alphabet/composite/alphabet_variant_char_representation.cpp b/test/snippet/alphabet/composite/alphabet_variant_char_representation.cpp index cf4940364c..09c5504ce1 100644 --- a/test/snippet/alphabet/composite/alphabet_variant_char_representation.cpp +++ b/test/snippet/alphabet/composite/alphabet_variant_char_representation.cpp @@ -3,7 +3,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::alphabet_variant var; var.assign_char('A'); // will be in the "dna4-state" diff --git a/test/snippet/alphabet/composite/alphabet_variant_conversion.cpp b/test/snippet/alphabet/composite/alphabet_variant_conversion.cpp index caf0f07077..27f9d59009 100644 --- a/test/snippet/alphabet/composite/alphabet_variant_conversion.cpp +++ b/test/snippet/alphabet/composite/alphabet_variant_conversion.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_rna4; + using namespace seqan3::literals; seqan3::alphabet_variant letter1{'C'_rna4}; seqan3::alphabet_variant letter2 = 'C'_rna4; diff --git a/test/snippet/alphabet/composite/alphabet_variant_conversion_explicit.cpp b/test/snippet/alphabet/composite/alphabet_variant_conversion_explicit.cpp index 108f9baa21..d098c05c53 100644 --- a/test/snippet/alphabet/composite/alphabet_variant_conversion_explicit.cpp +++ b/test/snippet/alphabet/composite/alphabet_variant_conversion_explicit.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; // possible: seqan3::alphabet_variant letter1{'C'_dna5}; diff --git a/test/snippet/alphabet/composite/alphabet_variant_subtype_construction.cpp b/test/snippet/alphabet/composite/alphabet_variant_subtype_construction.cpp index fb290a6a4a..3a8a90b3f7 100644 --- a/test/snippet/alphabet/composite/alphabet_variant_subtype_construction.cpp +++ b/test/snippet/alphabet/composite/alphabet_variant_subtype_construction.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_rna4; + using namespace seqan3::literals; seqan3::alphabet_variant letter1{}; letter1 = 'C'_rna4; diff --git a/test/snippet/alphabet/composite/alphabet_variant_value_construction.cpp b/test/snippet/alphabet/composite/alphabet_variant_value_construction.cpp index a3c880419a..bec0070dfe 100644 --- a/test/snippet/alphabet/composite/alphabet_variant_value_construction.cpp +++ b/test/snippet/alphabet/composite/alphabet_variant_value_construction.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::alphabet_variant letter1{'C'_dna4}; // or seqan3::alphabet_variant letter2 = seqan3::gap{}; diff --git a/test/snippet/alphabet/composite/semialphabet_any.cpp b/test/snippet/alphabet/composite/semialphabet_any.cpp index 287e95951e..323c2f9b91 100644 --- a/test/snippet/alphabet/composite/semialphabet_any.cpp +++ b/test/snippet/alphabet/composite/semialphabet_any.cpp @@ -11,8 +11,7 @@ #include #include -using seqan3::operator""_aa10murphy; -using seqan3::operator""_aa10li; +using namespace seqan3::literals; // Print is a template and gets instantiated two times because the behaviour is different for both types template diff --git a/test/snippet/alphabet/gap/gapped.cpp b/test/snippet/alphabet/gap/gapped.cpp index fed4ff53d0..504f7e99bf 100644 --- a/test/snippet/alphabet/gap/gapped.cpp +++ b/test/snippet/alphabet/gap/gapped.cpp @@ -3,7 +3,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::gapped gapped_letter{}; seqan3::gapped converted_letter{'C'_dna4}; diff --git a/test/snippet/alphabet/mask/masked.cpp b/test/snippet/alphabet/mask/masked.cpp index d0bf0e2d89..78c9fbb831 100644 --- a/test/snippet/alphabet/mask/masked.cpp +++ b/test/snippet/alphabet/mask/masked.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::masked dna4_masked{}; seqan3::masked dna4_another_masked{'A'_dna4, seqan3::mask::UNMASKED}; diff --git a/test/snippet/alphabet/nucleotide/complement_cpo.cpp b/test/snippet/alphabet/nucleotide/complement_cpo.cpp index 9a55356470..665404f0f6 100644 --- a/test/snippet/alphabet/nucleotide/complement_cpo.cpp +++ b/test/snippet/alphabet/nucleotide/complement_cpo.cpp @@ -1,7 +1,7 @@ #include #include -using seqan3::operator""_rna5; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/alphabet/nucleotide/dna15.cpp b/test/snippet/alphabet/nucleotide/dna15.cpp index 72fb122c58..89a5800a37 100644 --- a/test/snippet/alphabet/nucleotide/dna15.cpp +++ b/test/snippet/alphabet/nucleotide/dna15.cpp @@ -3,14 +3,13 @@ int main() { - using seqan3::operator""_dna15; + using namespace seqan3::literals; - seqan3::dna15 my_letter{'A'_dna15}; + seqan3::dna15 letter{'A'_dna15}; - my_letter.assign_char('C'); - - my_letter.assign_char('F'); // unknown characters are implicitly converted to N. - if (my_letter.to_char() == 'N') - seqan3::debug_stream << "yeah\n"; // "yeah"; + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" + letter.assign_char('F'); // Unknown characters are implicitly converted to N. + seqan3::debug_stream << letter << '\n'; // prints "N" } diff --git a/test/snippet/alphabet/nucleotide/dna15_char_literal.cpp b/test/snippet/alphabet/nucleotide/dna15_char_literal.cpp new file mode 100644 index 0000000000..83fb5247e7 --- /dev/null +++ b/test/snippet/alphabet/nucleotide/dna15_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::dna15 letter1{'A'_dna15}; + auto letter2 = 'A'_dna15; +} diff --git a/test/snippet/alphabet/nucleotide/dna15_literal.cpp b/test/snippet/alphabet/nucleotide/dna15_literal.cpp index 41a6ba3177..e9ee20cef7 100644 --- a/test/snippet/alphabet/nucleotide/dna15_literal.cpp +++ b/test/snippet/alphabet/nucleotide/dna15_literal.cpp @@ -2,9 +2,9 @@ int main() { - using seqan3::operator""_dna15; - - seqan3::dna15_vector foo{"ACGTTA"_dna15}; - seqan3::dna15_vector bar = "ACGTTA"_dna15; - auto bax = "ACGTTA"_dna15; + using namespace seqan3::literals; + + seqan3::dna15_vector sequence1{"ACGTTA"_dna15}; + seqan3::dna15_vector sequence2 = "ACGTTA"_dna15; + auto sequence3 = "ACGTTA"_dna15; } diff --git a/test/snippet/alphabet/nucleotide/dna16sam.cpp b/test/snippet/alphabet/nucleotide/dna16sam.cpp index a8c2e05b18..072550ccb0 100644 --- a/test/snippet/alphabet/nucleotide/dna16sam.cpp +++ b/test/snippet/alphabet/nucleotide/dna16sam.cpp @@ -3,12 +3,13 @@ int main() { - using seqan3::operator""_dna16sam; + using namespace seqan3::literals; - seqan3::dna16sam my_letter{'A'_dna16sam}; + seqan3::dna16sam letter{'A'_dna16sam}; - my_letter.assign_char('='); + letter.assign_char('='); + seqan3::debug_stream << letter << '\n'; // prints "=" - my_letter.assign_char('F'); // unknown characters are implicitly converted to N. - seqan3::debug_stream << my_letter << '\n'; // "N"; + letter.assign_char('F'); // Unknown characters are implicitly converted to N. + seqan3::debug_stream << letter << '\n'; // "N"; } diff --git a/test/snippet/alphabet/nucleotide/dna16sam_char_literal.cpp b/test/snippet/alphabet/nucleotide/dna16sam_char_literal.cpp new file mode 100644 index 0000000000..59df35ef83 --- /dev/null +++ b/test/snippet/alphabet/nucleotide/dna16sam_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::dna16sam letter1{'A'_dna16sam}; + auto letter2 = 'A'_dna16sam; +} diff --git a/test/snippet/alphabet/nucleotide/dna16sam_literal.cpp b/test/snippet/alphabet/nucleotide/dna16sam_literal.cpp index 8ade683d06..4e4c36998c 100644 --- a/test/snippet/alphabet/nucleotide/dna16sam_literal.cpp +++ b/test/snippet/alphabet/nucleotide/dna16sam_literal.cpp @@ -1,13 +1,10 @@ #include -#include int main() { - using seqan3::operator""_dna16sam; + using namespace seqan3::literals; - seqan3::dna16sam_vector foo{"ACgtTA"_dna16sam}; - seqan3::dna16sam_vector bar = "ACG==A"_dna16sam; - auto bax = "A=GTT!"_dna16sam; - - seqan3::debug_stream << foo << "\n" << bar << "\n" << bax << "\n"; + seqan3::dna16sam_vector sequence1{"ACGTTA"_dna16sam}; + seqan3::dna16sam_vector sequence2 = "ACGTTA"_dna16sam; + auto sequence3 = "ACGTTA"_dna16sam; } diff --git a/test/snippet/alphabet/nucleotide/dna3bs.cpp b/test/snippet/alphabet/nucleotide/dna3bs.cpp index 92e4b4acff..ba3c273641 100644 --- a/test/snippet/alphabet/nucleotide/dna3bs.cpp +++ b/test/snippet/alphabet/nucleotide/dna3bs.cpp @@ -3,17 +3,13 @@ int main() { - using seqan3::operator""_dna3bs; + using namespace seqan3::literals; - seqan3::dna3bs my_letter{'A'_dna3bs}; + seqan3::dna3bs letter{'A'_dna3bs}; - my_letter.assign_char('C'); // all C will be converted to T. - if (my_letter.to_char() == 'T') - seqan3::debug_stream << "yeah\n"; // "yeah"; + letter.assign_char('C'); // All C will be converted to T. + seqan3::debug_stream << letter << '\n'; // prints "T" - my_letter.assign_char('F'); // unknown characters are implicitly converted to A. - if (my_letter.to_char() == 'A') - seqan3::debug_stream << "yeah\n"; // "yeah"; - - return 0; + letter.assign_char('F'); // Unknown characters are implicitly converted to A. + seqan3::debug_stream << letter << '\n'; // prints "A" } diff --git a/test/snippet/alphabet/nucleotide/dna3bs_char_literal.cpp b/test/snippet/alphabet/nucleotide/dna3bs_char_literal.cpp new file mode 100644 index 0000000000..d6b6c5f733 --- /dev/null +++ b/test/snippet/alphabet/nucleotide/dna3bs_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::dna3bs letter1{'A'_dna3bs}; + auto letter2 = 'A'_dna3bs; +} diff --git a/test/snippet/alphabet/nucleotide/dna3bs_literal.cpp b/test/snippet/alphabet/nucleotide/dna3bs_literal.cpp index 714445ce64..0c5f55db43 100644 --- a/test/snippet/alphabet/nucleotide/dna3bs_literal.cpp +++ b/test/snippet/alphabet/nucleotide/dna3bs_literal.cpp @@ -1,17 +1,10 @@ #include -#include int main() { - using seqan3::operator""_dna3bs; + using namespace seqan3::literals; - seqan3::dna3bs_vector foo{"ACGTTA"_dna3bs}; // ATGTTA - seqan3::dna3bs_vector bar = "ATGTTA"_dna3bs; - - if (foo == bar) - seqan3::debug_stream << "yeah\n"; // "yeah"; - - auto bax = "ACGTTA"_dna3bs; - - return 0; + seqan3::dna3bs_vector sequence1{"ACGTTA"_dna3bs}; + seqan3::dna3bs_vector sequence2 = "ACGTTA"_dna3bs; + auto sequence3 = "ACGTTA"_dna3bs; } diff --git a/test/snippet/alphabet/nucleotide/dna4.cpp b/test/snippet/alphabet/nucleotide/dna4.cpp index 621a29b2b4..9c50a76291 100644 --- a/test/snippet/alphabet/nucleotide/dna4.cpp +++ b/test/snippet/alphabet/nucleotide/dna4.cpp @@ -3,25 +3,25 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; - seqan3::dna4 my_letter{'C'_dna4}; + seqan3::dna4 letter{'C'_dna4}; - my_letter.assign_char('F'); // characters other than IUPAC characters are implicitly converted to A. - seqan3::debug_stream << my_letter << '\n'; // prints "A" + letter.assign_char('F'); // Characters other than IUPAC characters are implicitly converted to A. + seqan3::debug_stream << letter << '\n'; // prints "A" // IUPAC characters are implicitly converted to their best fitting representative - seqan3::debug_stream << my_letter.assign_char('R') << '\n'; // prints "A" - seqan3::debug_stream << my_letter.assign_char('Y') << '\n'; // prints "C" - seqan3::debug_stream << my_letter.assign_char('S') << '\n'; // prints "C" - seqan3::debug_stream << my_letter.assign_char('W') << '\n'; // prints "A" - seqan3::debug_stream << my_letter.assign_char('K') << '\n'; // prints "G" - seqan3::debug_stream << my_letter.assign_char('M') << '\n'; // prints "A" - seqan3::debug_stream << my_letter.assign_char('B') << '\n'; // prints "C" - seqan3::debug_stream << my_letter.assign_char('D') << '\n'; // prints "A" - seqan3::debug_stream << my_letter.assign_char('H') << '\n'; // prints "A" - seqan3::debug_stream << my_letter.assign_char('V') << '\n'; // prints "A" + seqan3::debug_stream << letter.assign_char('R') << '\n'; // prints "A" + seqan3::debug_stream << letter.assign_char('Y') << '\n'; // prints "C" + seqan3::debug_stream << letter.assign_char('S') << '\n'; // prints "C" + seqan3::debug_stream << letter.assign_char('W') << '\n'; // prints "A" + seqan3::debug_stream << letter.assign_char('K') << '\n'; // prints "G" + seqan3::debug_stream << letter.assign_char('M') << '\n'; // prints "A" + seqan3::debug_stream << letter.assign_char('B') << '\n'; // prints "C" + seqan3::debug_stream << letter.assign_char('D') << '\n'; // prints "A" + seqan3::debug_stream << letter.assign_char('H') << '\n'; // prints "A" + seqan3::debug_stream << letter.assign_char('V') << '\n'; // prints "A" - my_letter.assign_char('a'); // lower case letters are the same as their upper case equivalent - seqan3::debug_stream << my_letter << '\n'; // prints "A"; + letter.assign_char('a'); // Lower case letters are the same as their upper case equivalent. + seqan3::debug_stream << letter << '\n'; // prints "A" } diff --git a/test/snippet/alphabet/nucleotide/dna4_char_literal.cpp b/test/snippet/alphabet/nucleotide/dna4_char_literal.cpp new file mode 100644 index 0000000000..7bf5134ff8 --- /dev/null +++ b/test/snippet/alphabet/nucleotide/dna4_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::dna4 letter1{'A'_dna4}; + auto letter2 = 'A'_dna4; +} diff --git a/test/snippet/alphabet/nucleotide/dna4_literal.cpp b/test/snippet/alphabet/nucleotide/dna4_literal.cpp index 80e22d66bb..4e1d45e7d8 100644 --- a/test/snippet/alphabet/nucleotide/dna4_literal.cpp +++ b/test/snippet/alphabet/nucleotide/dna4_literal.cpp @@ -2,9 +2,9 @@ int main() { - using seqan3::operator""_dna4; - - seqan3::dna4_vector foo{"ACGTTA"_dna4}; - seqan3::dna4_vector bar = "ACGTTA"_dna4; - auto bax = "ACGTTA"_dna4; + using namespace seqan3::literals; + + seqan3::dna4_vector sequence1{"ACGTTA"_dna4}; + seqan3::dna4_vector sequence2 = "ACGTTA"_dna4; + auto sequence3 = "ACGTTA"_dna4; } diff --git a/test/snippet/alphabet/nucleotide/dna5.cpp b/test/snippet/alphabet/nucleotide/dna5.cpp index cc1f0f9f56..2b5c4958b2 100644 --- a/test/snippet/alphabet/nucleotide/dna5.cpp +++ b/test/snippet/alphabet/nucleotide/dna5.cpp @@ -3,13 +3,13 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; - seqan3::dna5 my_letter{'A'_dna5}; + seqan3::dna5 letter{'A'_dna5}; - my_letter.assign_char('C'); + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" - my_letter.assign_char('F'); // unknown characters are implicitly converted to N. - if (my_letter.to_char() == 'N') - seqan3::debug_stream << "yeah\n"; // "yeah"; + letter.assign_char('F'); // Unknown characters are implicitly converted to N. + seqan3::debug_stream << letter << '\n'; // prints "N" } diff --git a/test/snippet/alphabet/nucleotide/dna5_char_literal.cpp b/test/snippet/alphabet/nucleotide/dna5_char_literal.cpp new file mode 100644 index 0000000000..dfe2c58d57 --- /dev/null +++ b/test/snippet/alphabet/nucleotide/dna5_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::dna5 letter1{'A'_dna5}; + auto letter2 = 'A'_dna5; +} diff --git a/test/snippet/alphabet/nucleotide/dna5_literal.cpp b/test/snippet/alphabet/nucleotide/dna5_literal.cpp index 7aec25d2b1..4642e8077e 100644 --- a/test/snippet/alphabet/nucleotide/dna5_literal.cpp +++ b/test/snippet/alphabet/nucleotide/dna5_literal.cpp @@ -2,9 +2,9 @@ int main() { - using seqan3::operator""_dna5; - - seqan3::dna5_vector foo{"ACGTTA"_dna5}; - seqan3::dna5_vector bar = "ACGTTA"_dna5; - auto bax = "ACGTTA"_dna5; + using namespace seqan3::literals; + + seqan3::dna5_vector sequence1{"ACGTTA"_dna5}; + seqan3::dna5_vector sequence2 = "ACGTTA"_dna5; + auto sequence3 = "ACGTTA"_dna5; } diff --git a/test/snippet/alphabet/nucleotide/rna15.cpp b/test/snippet/alphabet/nucleotide/rna15.cpp index 303de8127d..fb934960ca 100644 --- a/test/snippet/alphabet/nucleotide/rna15.cpp +++ b/test/snippet/alphabet/nucleotide/rna15.cpp @@ -3,13 +3,13 @@ int main() { - using seqan3::operator""_rna15; + using namespace seqan3::literals; - seqan3::rna15 my_letter{'A'_rna15}; + seqan3::rna15 letter{'A'_rna15}; - my_letter.assign_char('C'); + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" - my_letter.assign_char('F'); // unknown characters are implicitly converted to N. - if (my_letter.to_char() == 'N') - seqan3::debug_stream << "yeah\n"; // "yeah"; + letter.assign_char('F'); // Unknown characters are implicitly converted to N. + seqan3::debug_stream << letter << '\n'; // prints "N" } diff --git a/test/snippet/alphabet/nucleotide/rna15_char_literal.cpp b/test/snippet/alphabet/nucleotide/rna15_char_literal.cpp new file mode 100644 index 0000000000..2940127b4d --- /dev/null +++ b/test/snippet/alphabet/nucleotide/rna15_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::rna15 letter1{'A'_rna15}; + auto letter2 = 'A'_rna15; +} diff --git a/test/snippet/alphabet/nucleotide/rna15_literal.cpp b/test/snippet/alphabet/nucleotide/rna15_literal.cpp index fe3bcc4a06..98dbdd8646 100644 --- a/test/snippet/alphabet/nucleotide/rna15_literal.cpp +++ b/test/snippet/alphabet/nucleotide/rna15_literal.cpp @@ -2,9 +2,9 @@ int main() { - using seqan3::operator""_rna15; - - seqan3::rna15_vector foo{"ACGTTA"_rna15}; - seqan3::rna15_vector bar = "ACGTTA"_rna15; - auto bax = "ACGTTA"_rna15; + using namespace seqan3::literals; + + seqan3::rna15_vector sequence1{"ACGTTA"_rna15}; + seqan3::rna15_vector sequence2 = "ACGTTA"_rna15; + auto sequence3 = "ACGTTA"_rna15; } diff --git a/test/snippet/alphabet/nucleotide/rna4.cpp b/test/snippet/alphabet/nucleotide/rna4.cpp index 8f7ee3b90f..8d9c5eb494 100644 --- a/test/snippet/alphabet/nucleotide/rna4.cpp +++ b/test/snippet/alphabet/nucleotide/rna4.cpp @@ -3,13 +3,13 @@ int main() { - using seqan3::operator""_rna4; + using namespace seqan3::literals; - seqan3::rna4 my_letter{'A'_rna4}; + seqan3::rna4 letter{'A'_rna4}; - my_letter.assign_char('C'); + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" - my_letter.assign_char('F'); // unknown characters are implicitly converted to A. - if (my_letter.to_char() == 'A') - seqan3::debug_stream << "yeah\n"; // "yeah"; + letter.assign_char('F'); // Unknown characters are implicitly converted to A. + seqan3::debug_stream << letter << '\n'; // prints "A" } diff --git a/test/snippet/alphabet/nucleotide/rna4_char_literal.cpp b/test/snippet/alphabet/nucleotide/rna4_char_literal.cpp new file mode 100644 index 0000000000..9bf4ee0ef0 --- /dev/null +++ b/test/snippet/alphabet/nucleotide/rna4_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::rna4 letter1{'A'_rna4}; + auto letter2 = 'A'_rna4; +} diff --git a/test/snippet/alphabet/nucleotide/rna4_literal.cpp b/test/snippet/alphabet/nucleotide/rna4_literal.cpp index 5f296a1398..fbb9a3152c 100644 --- a/test/snippet/alphabet/nucleotide/rna4_literal.cpp +++ b/test/snippet/alphabet/nucleotide/rna4_literal.cpp @@ -2,9 +2,9 @@ int main() { - using seqan3::operator""_rna4; - - seqan3::rna4_vector foo{"ACGTTA"_rna4}; - seqan3::rna4_vector bar = "ACGTTA"_rna4; - auto bax = "ACGTTA"_rna4; + using namespace seqan3::literals; + + seqan3::rna4_vector sequence1{"ACGTTA"_rna4}; + seqan3::rna4_vector sequence2 = "ACGTTA"_rna4; + auto sequence3 = "ACGTTA"_rna4; } diff --git a/test/snippet/alphabet/nucleotide/rna5.cpp b/test/snippet/alphabet/nucleotide/rna5.cpp index 6c0939913d..784b772766 100644 --- a/test/snippet/alphabet/nucleotide/rna5.cpp +++ b/test/snippet/alphabet/nucleotide/rna5.cpp @@ -2,13 +2,13 @@ #include int main() { - using seqan3::operator""_rna5; + using namespace seqan3::literals; - seqan3::rna5 my_letter{'A'_rna5}; + seqan3::rna5 letter{'A'_rna5}; - my_letter.assign_char('C'); - - my_letter.assign_char('F'); // unknown characters are implicitly converted to N. - if (my_letter.to_char() == 'N') - seqan3::debug_stream << "yeah\n"; // "yeah"; + letter.assign_char('C'); + seqan3::debug_stream << letter << '\n'; // prints "C" + + letter.assign_char('F'); // Unknown characters are implicitly converted to N. + seqan3::debug_stream << letter << '\n'; // prints "N" } diff --git a/test/snippet/alphabet/nucleotide/rna5_char_literal.cpp b/test/snippet/alphabet/nucleotide/rna5_char_literal.cpp new file mode 100644 index 0000000000..fc753731eb --- /dev/null +++ b/test/snippet/alphabet/nucleotide/rna5_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::rna5 letter1{'A'_rna5}; + auto letter2 = 'A'_rna5; +} diff --git a/test/snippet/alphabet/nucleotide/rna5_literal.cpp b/test/snippet/alphabet/nucleotide/rna5_literal.cpp index d2039b0f2e..e0dbf16cab 100644 --- a/test/snippet/alphabet/nucleotide/rna5_literal.cpp +++ b/test/snippet/alphabet/nucleotide/rna5_literal.cpp @@ -2,9 +2,9 @@ int main() { - using seqan3::operator""_rna5; - - seqan3::rna5_vector foo{"ACGTTA"_rna5}; - seqan3::rna5_vector bar = "ACGTTA"_rna5; - auto bax = "ACGTTA"_rna5; + using namespace seqan3::literals; + + seqan3::rna5_vector sequence1{"ACGTTA"_rna5}; + seqan3::rna5_vector sequence2 = "ACGTTA"_rna5; + auto sequence3 = "ACGTTA"_rna5; } diff --git a/test/snippet/alphabet/quality/phred42.cpp b/test/snippet/alphabet/quality/phred42.cpp index a295cd8dfb..33800e160d 100644 --- a/test/snippet/alphabet/quality/phred42.cpp +++ b/test/snippet/alphabet/quality/phred42.cpp @@ -1,27 +1,16 @@ -#include #include -#include #include -using seqan3::operator""_dna4; -using seqan3::operator""_phred42; - int main() { - seqan3::phred42 phred; - phred.assign_phred(2); - seqan3::debug_stream << phred.to_phred() << "\n"; // 2 - seqan3::debug_stream << phred.to_char() << "\n"; // '#' - seqan3::debug_stream << phred.to_rank() << "\n"; // 2 + using namespace seqan3::literals; - seqan3::phred42 another_phred = '('_phred42; - seqan3::debug_stream << another_phred.to_phred() << "\n"; // 52 + seqan3::phred42 letter{'@'_phred42}; - another_phred.assign_phred(49); // converted down to 41 - seqan3::debug_stream << another_phred.to_phred() << "\n"; // 41 + letter.assign_char('!'); + seqan3::debug_stream << letter.to_phred() << '\n'; // prints "0" + seqan3::debug_stream << letter.to_char() << '\n'; // prints "!" - std::vector> query{{'A'_dna4, '!'_phred42}, - {'C'_dna4, 'A'_phred42}, - {'G'_dna4, '6'_phred42}, - {'T'_dna4, '&'_phred42}}; + letter.assign_phred(49); // Values exceeding the maximum are implicitly limited to the maximum phred value. + seqan3::debug_stream << letter.to_phred() << '\n'; // prints "41" } diff --git a/test/snippet/alphabet/quality/phred42_char_literal.cpp b/test/snippet/alphabet/quality/phred42_char_literal.cpp new file mode 100644 index 0000000000..c8a77685e3 --- /dev/null +++ b/test/snippet/alphabet/quality/phred42_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::phred42 letter1{'!'_phred42}; + auto letter2 = '!'_phred42; +} diff --git a/test/snippet/alphabet/quality/phred42_literal.cpp b/test/snippet/alphabet/quality/phred42_literal.cpp index dde62fb2fa..b38c075e15 100644 --- a/test/snippet/alphabet/quality/phred42_literal.cpp +++ b/test/snippet/alphabet/quality/phred42_literal.cpp @@ -1,16 +1,10 @@ #include -#include -#include int main() { - using seqan3::operator""_phred42; + using namespace seqan3::literals; - // directly assign to a std::vector using a string literal - std::vector qual_vec = "###!"_phred42; - - // This is the same as a sequence of char literals: - std::vector qual_vec2 = {'#'_phred42, '#'_phred42, '#'_phred42, '!'_phred42}; - - seqan3::debug_stream << std::ranges::equal(qual_vec, qual_vec2) << '\n'; // prints 1 (true) + std::vector sequence1{"##!!##"_phred42}; + std::vector sequence2 = "##!!##"_phred42; + auto sequence3 = "##!!##"_phred42; } diff --git a/test/snippet/alphabet/quality/phred63.cpp b/test/snippet/alphabet/quality/phred63.cpp index 9413eb0f73..9987008581 100644 --- a/test/snippet/alphabet/quality/phred63.cpp +++ b/test/snippet/alphabet/quality/phred63.cpp @@ -1,31 +1,16 @@ -#include #include -#include #include -using seqan3::operator""_dna4; -using seqan3::operator""_phred63; - int main() { - seqan3::phred63 phred; - phred.assign_phred(2); - seqan3::debug_stream << phred.to_phred() << "\n"; // 2 - seqan3::debug_stream << phred.to_char() << "\n"; // '#' - seqan3::debug_stream << phred.to_rank() << "\n"; // 2 - - seqan3::phred63 another_phred = 'U'_phred63; - seqan3::debug_stream << another_phred.to_phred() << "\n"; // 52 + using namespace seqan3::literals; - another_phred.assign_phred(49); - seqan3::debug_stream << another_phred.to_phred() << "\n"; // 49 + seqan3::phred63 letter{'@'_phred63}; - seqan3::phred63 a_third_phred; - a_third_phred.assign_phred(75); // converted down to 62 - seqan3::debug_stream << a_third_phred.to_phred() << "\n"; // 62 + letter.assign_char('!'); + seqan3::debug_stream << letter.to_phred() << '\n'; // prints "0" + seqan3::debug_stream << letter.to_char() << '\n'; // prints "!" - std::vector> query{{'A'_dna4, '!'_phred63}, - {'C'_dna4, 'A'_phred63}, - {'G'_dna4, '6'_phred63}, - {'T'_dna4, '&'_phred63}}; + letter.assign_phred(72); // Values exceeding the maximum are implicitly limited to the maximum phred value. + seqan3::debug_stream << letter.to_phred() << '\n'; // prints "62" } diff --git a/test/snippet/alphabet/quality/phred63_char_literal.cpp b/test/snippet/alphabet/quality/phred63_char_literal.cpp new file mode 100644 index 0000000000..9c811d4ddd --- /dev/null +++ b/test/snippet/alphabet/quality/phred63_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::phred63 letter1{'!'_phred63}; + auto letter2 = '!'_phred63; +} diff --git a/test/snippet/alphabet/quality/phred63_literal.cpp b/test/snippet/alphabet/quality/phred63_literal.cpp index a12afec867..89b39940e9 100644 --- a/test/snippet/alphabet/quality/phred63_literal.cpp +++ b/test/snippet/alphabet/quality/phred63_literal.cpp @@ -1,16 +1,10 @@ #include -#include -#include int main() { - using seqan3::operator""_phred63; + using namespace seqan3::literals; - // directly assign to a std::vector using a string literal - std::vector qual_vec = "###!"_phred63; - - // This is the same as a sequence of char literals: - std::vector qual_vec2 = {'#'_phred63, '#'_phred63, '#'_phred63, '!'_phred63}; - - seqan3::debug_stream << std::ranges::equal(qual_vec, qual_vec2) << '\n'; // prints 1 (true) + std::vector sequence1{"##!!##"_phred63}; + std::vector sequence2 = "##!!##"_phred63; + auto sequence3 = "##!!##"_phred63; } diff --git a/test/snippet/alphabet/quality/phred68solexa.cpp b/test/snippet/alphabet/quality/phred68solexa.cpp index 973d8f969e..72d8917c00 100644 --- a/test/snippet/alphabet/quality/phred68solexa.cpp +++ b/test/snippet/alphabet/quality/phred68solexa.cpp @@ -3,9 +3,14 @@ int main() { - seqan3::phred68solexa phred; - phred.assign_phred(-2); - seqan3::debug_stream << (int) phred.to_phred() << "\n"; // -2 - seqan3::debug_stream << phred.to_char() << "\n"; // '>' - seqan3::debug_stream << (int) phred.to_rank() << "\n"; // 3 + using namespace seqan3::literals; + + seqan3::phred68solexa letter{'@'_phred68solexa}; + + letter.assign_char(';'); + seqan3::debug_stream << letter.to_phred() << '\n'; // prints "-5" + seqan3::debug_stream << letter.to_char() << '\n'; // prints ";" + + letter.assign_phred(72); // Values exceeding the maximum are implicitly limited to the maximum phred value. + seqan3::debug_stream << letter.to_phred() << '\n'; // prints "62" } diff --git a/test/snippet/alphabet/quality/phred68solexa_char_literal.cpp b/test/snippet/alphabet/quality/phred68solexa_char_literal.cpp new file mode 100644 index 0000000000..283186068d --- /dev/null +++ b/test/snippet/alphabet/quality/phred68solexa_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::phred68solexa letter1{'!'_phred68solexa}; + auto letter2 = '!'_phred68solexa; +} diff --git a/test/snippet/alphabet/quality/phred68solexa_literal.cpp b/test/snippet/alphabet/quality/phred68solexa_literal.cpp index 41de6b1501..c258cbbcb0 100644 --- a/test/snippet/alphabet/quality/phred68solexa_literal.cpp +++ b/test/snippet/alphabet/quality/phred68solexa_literal.cpp @@ -1,17 +1,10 @@ #include -#include -#include int main() { - using seqan3::operator""_phred68solexa; + using namespace seqan3::literals; - // directly assign to a std::vector using a string literal - std::vector qual_vec = "###!"_phred68solexa; - - // This is the same as a sequence of char literals: - std::vector qual_vec2 = {'#'_phred68solexa, '#'_phred68solexa, - '#'_phred68solexa, '!'_phred68solexa}; - - seqan3::debug_stream << std::ranges::equal(qual_vec, qual_vec2) << '\n'; // prints 1 (true) + std::vector sequence1{"##!!##"_phred68solexa}; + std::vector sequence2 = "##!!##"_phred68solexa; + auto sequence3 = "##!!##"_phred68solexa; } diff --git a/test/snippet/alphabet/quality/phred94.cpp b/test/snippet/alphabet/quality/phred94.cpp index c4465e74f2..5207418d35 100644 --- a/test/snippet/alphabet/quality/phred94.cpp +++ b/test/snippet/alphabet/quality/phred94.cpp @@ -1,23 +1,16 @@ #include #include -using seqan3::operator""_phred94; - int main() { - seqan3::phred94 phred; - phred.assign_phred(2); - seqan3::debug_stream << phred.to_phred() << "\n"; // 2 - seqan3::debug_stream << phred.to_char() << "\n"; // '#' - seqan3::debug_stream << phred.to_rank() << "\n"; // 2 + using namespace seqan3::literals; - seqan3::phred94 another_phred = '('_phred94; - seqan3::debug_stream << another_phred.to_phred() << "\n"; // 7 + seqan3::phred94 letter{'@'_phred94}; - another_phred.assign_phred(75); - seqan3::debug_stream << another_phred.to_phred() << "\n"; // 75 + letter.assign_char('!'); + seqan3::debug_stream << letter.to_phred() << '\n'; // prints "0" + seqan3::debug_stream << letter.to_char() << '\n'; // prints "!" - seqan3::phred94 a_third_phred; - a_third_phred.assign_phred(105); // converted down to 93 - seqan3::debug_stream << a_third_phred.to_phred() << "\n"; // 93 + letter.assign_phred(99); // Values exceeding the maximum are implicitly limited to the maximum phred value. + seqan3::debug_stream << letter.to_phred() << '\n'; // prints "93" } diff --git a/test/snippet/alphabet/quality/phred94_char_literal.cpp b/test/snippet/alphabet/quality/phred94_char_literal.cpp new file mode 100644 index 0000000000..cd774f2164 --- /dev/null +++ b/test/snippet/alphabet/quality/phred94_char_literal.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::phred94 letter1{'!'_phred94}; + auto letter2 = '!'_phred94; +} diff --git a/test/snippet/alphabet/quality/phred94_literal.cpp b/test/snippet/alphabet/quality/phred94_literal.cpp index 8010f09baa..3f1f11c4a3 100644 --- a/test/snippet/alphabet/quality/phred94_literal.cpp +++ b/test/snippet/alphabet/quality/phred94_literal.cpp @@ -1,17 +1,10 @@ -#include - #include -#include int main() { - using seqan3::operator""_phred94; - - // directly assign to a std::vector using a string literal - std::vector qual_vec = "###!"_phred94; - - // This is the same as a sequence of char literals: - std::vector qual_vec2 = {'#'_phred94, '#'_phred94, '#'_phred94, '!'_phred94}; + using namespace seqan3::literals; - seqan3::debug_stream << std::ranges::equal(qual_vec, qual_vec2) << '\n'; // prints 1 (true) + std::vector sequence1{"##!!##"_phred94}; + std::vector sequence2 = "##!!##"_phred94; + auto sequence3 = "##!!##"_phred94; } diff --git a/test/snippet/alphabet/quality/qualified.cpp b/test/snippet/alphabet/quality/qualified.cpp index 0f740098b2..26dcaa52f7 100644 --- a/test/snippet/alphabet/quality/qualified.cpp +++ b/test/snippet/alphabet/quality/qualified.cpp @@ -1,32 +1,32 @@ -#include -#include #include +#include +#include #include int main() { - using seqan3::operator""_dna4; - using seqan3::operator""_phred42; + using namespace seqan3::literals; using seqan3::get; seqan3::qualified letter{'A'_dna4, '('_phred42}; - seqan3::debug_stream << int(seqan3::to_rank(letter)) << ' ' - << int(seqan3::to_rank(get<0>(letter))) << ' ' - << int(seqan3::to_rank(get<1>(letter))) << '\n'; - // 28 0 7 + + seqan3::debug_stream << seqan3::to_rank(letter) << ' ' + << seqan3::to_rank(get<0>(letter)) << ' ' + << seqan3::to_rank(get<1>(letter)) << '\n'; + // prints "7 0 7" seqan3::debug_stream << seqan3::to_char(letter) << ' ' << seqan3::to_char(get<0>(letter)) << ' ' << seqan3::to_char(get<1>(letter)) << '\n'; - // A A ( + // prints "A A (" seqan3::debug_stream << seqan3::to_phred(letter) << ' ' << seqan3::to_phred(get<1>(letter)) << '\n'; - // 7 7 + // prints "7 7" - // modify via structured bindings and references: - auto & [ seq_l, qual_l ] = letter; - seq_l = 'G'_dna4; + // Modify via structured bindings and references: + auto & [ sequence_letter, quality_letter ] = letter; + sequence_letter = 'G'_dna4; seqan3::debug_stream << seqan3::to_char(letter) << '\n'; - // G + // prints "G" } diff --git a/test/snippet/alphabet/structure/dot_bracket3.cpp b/test/snippet/alphabet/structure/dot_bracket3.cpp new file mode 100644 index 0000000000..b9f525907c --- /dev/null +++ b/test/snippet/alphabet/structure/dot_bracket3.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::dot_bracket3 letter{'.'_db3}; + + letter.assign_char('('); + seqan3::debug_stream << letter << '\n'; // prints "(" + + letter.assign_char('F'); // Unknown characters are implicitly converted to '.'. + seqan3::debug_stream << letter << '\n'; // prints "." +} diff --git a/test/snippet/alphabet/structure/dot_bracket3_char_literal.cpp b/test/snippet/alphabet/structure/dot_bracket3_char_literal.cpp index 9b3a2bada2..40bb8f02e4 100644 --- a/test/snippet/alphabet/structure/dot_bracket3_char_literal.cpp +++ b/test/snippet/alphabet/structure/dot_bracket3_char_literal.cpp @@ -2,10 +2,8 @@ int main() { - using seqan3::operator""_db3; + using namespace seqan3::literals; - // Using the char literal to assign a single dot bracket: - seqan3::dot_bracket3 my_letter{'('_db3}; - - my_letter.assign_char(')'); // <- assigns the char explicitly + seqan3::dot_bracket3 letter1{'('_db3}; + auto letter2 = '('_db3; } diff --git a/test/snippet/alphabet/structure/dot_bracket3_general.cpp b/test/snippet/alphabet/structure/dot_bracket3_general.cpp deleted file mode 100644 index 674fc5ad78..0000000000 --- a/test/snippet/alphabet/structure/dot_bracket3_general.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include - -#include -#include - -int main() -{ - using seqan3::operator""_db3; - - // create vector - std::vector vec{'.'_db3, ')'_db3, ')'_db3}; - - // modify and print - vec[1] = '('_db3; - - for (seqan3::dot_bracket3 chr : vec) - seqan3::debug_stream << seqan3::to_char(chr); // .() - - seqan3::debug_stream << "\n"; -} diff --git a/test/snippet/alphabet/structure/dot_bracket3_literal.cpp b/test/snippet/alphabet/structure/dot_bracket3_literal.cpp index 53d72f44ff..a5baf16f9c 100644 --- a/test/snippet/alphabet/structure/dot_bracket3_literal.cpp +++ b/test/snippet/alphabet/structure/dot_bracket3_literal.cpp @@ -1,13 +1,10 @@ -#include - #include int main() { - using seqan3::operator""_db3; + using namespace seqan3::literals; - // Using the string literal to assign a vector of dot brackets: - std::vector foo{".(..)."_db3}; - std::vector bar = ".(..)."_db3; - auto bax = ".(..)."_db3; + std::vector sequence1{".(..)."_db3}; + std::vector sequence2 = ".(..)."_db3; + auto sequence3 = ".(..)."_db3; } diff --git a/test/snippet/alphabet/structure/dssp9.cpp b/test/snippet/alphabet/structure/dssp9.cpp new file mode 100644 index 0000000000..0fc301d333 --- /dev/null +++ b/test/snippet/alphabet/structure/dssp9.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::dssp9 letter{'H'_dssp9}; + + letter.assign_char('B'); + seqan3::debug_stream << letter << '\n'; // prints "B" + + letter.assign_char('F'); // Unknown characters are implicitly converted to 'X'. + seqan3::debug_stream << letter << '\n'; // prints "X" +} diff --git a/test/snippet/alphabet/structure/dssp9_char_literal.cpp b/test/snippet/alphabet/structure/dssp9_char_literal.cpp index 0e969272db..648c98bc4f 100644 --- a/test/snippet/alphabet/structure/dssp9_char_literal.cpp +++ b/test/snippet/alphabet/structure/dssp9_char_literal.cpp @@ -2,10 +2,8 @@ int main() { - using seqan3::operator""_dssp9; + using namespace seqan3::literals; - // Using the char literal to assign a single DSSP annotation: - seqan3::dssp9 my_letter{'I'_dssp9}; - - my_letter.assign_char('G'); // <- assigns the char explicitly + seqan3::dssp9 letter1{'('_dssp9}; + auto letter2 = '('_dssp9; } diff --git a/test/snippet/alphabet/structure/dssp9_general.cpp b/test/snippet/alphabet/structure/dssp9_general.cpp deleted file mode 100644 index c226f989c4..0000000000 --- a/test/snippet/alphabet/structure/dssp9_general.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include - -#include -#include - -int main() -{ - using seqan3::operator""_dssp9; - - // create vector - std::vector vec{'E'_dssp9, 'H'_dssp9, 'H'_dssp9, 'H'_dssp9, 'T'_dssp9, 'G'_dssp9}; - - // modify and print - vec[1] = 'C'_dssp9; - - for (seqan3::dssp9 chr : vec) - seqan3::debug_stream << seqan3::to_char(chr); // ECHHTG - - seqan3::debug_stream << "\n"; -} diff --git a/test/snippet/alphabet/structure/dssp9_literal.cpp b/test/snippet/alphabet/structure/dssp9_literal.cpp index 8e7b7bba30..a9143d31f9 100644 --- a/test/snippet/alphabet/structure/dssp9_literal.cpp +++ b/test/snippet/alphabet/structure/dssp9_literal.cpp @@ -1,13 +1,10 @@ -#include - #include int main() { - using seqan3::operator""_dssp9; + using namespace seqan3::literals; - // Using the string literal to assign a vector of DSSP annotations: - std::vector foo{"EHHHHT"_dssp9}; - std::vector bar = "EHHHHT"_dssp9; - auto bax = "EHHHHT"_dssp9; + std::vector sequence1{"EHHHHT"_dssp9}; + std::vector sequence2 = "EHHHHT"_dssp9; + auto sequence3 = "EHHHHT"_dssp9; } diff --git a/test/snippet/alphabet/structure/structured_aa.cpp b/test/snippet/alphabet/structure/structured_aa.cpp index 7f815513ea..86574a69df 100644 --- a/test/snippet/alphabet/structure/structured_aa.cpp +++ b/test/snippet/alphabet/structure/structured_aa.cpp @@ -1,11 +1,11 @@ -#include #include +#include +#include #include int main() { - using seqan3::operator""_aa27; - using seqan3::operator""_dssp9; + using namespace seqan3::literals; using seqan3::get; seqan3::structured_aa letter{'W'_aa27, 'B'_dssp9}; @@ -13,16 +13,16 @@ int main() seqan3::debug_stream << seqan3::to_rank(letter) << ' ' << seqan3::to_rank(get<0>(letter)) << ' ' << seqan3::to_rank(get<1>(letter)) << '\n'; - // 49 22 1 + // prints "199 22 1" seqan3::debug_stream << seqan3::to_char(letter) << ' ' << seqan3::to_char(get<0>(letter)) << ' ' << seqan3::to_char(get<1>(letter)) << '\n'; - // W W B + // prints "W W B" - // modify via structured bindings and references: - auto & [ seq_l, structure_l ] = letter; - seq_l = 'V'_aa27; + // Modify via structured bindings and references: + auto & [ sequence_letter, structure_letter ] = letter; + sequence_letter = 'V'_aa27; seqan3::debug_stream << seqan3::to_char(letter) << '\n'; - // V + // prints "V" } diff --git a/test/snippet/alphabet/structure/structured_rna.cpp b/test/snippet/alphabet/structure/structured_rna.cpp index e27e01fb80..58674fe314 100644 --- a/test/snippet/alphabet/structure/structured_rna.cpp +++ b/test/snippet/alphabet/structure/structured_rna.cpp @@ -1,28 +1,28 @@ -#include #include #include +#include #include int main() { - using seqan3::operator""_rna4; - using seqan3::operator""_db3; + using namespace seqan3::literals; using seqan3::get; seqan3::structured_rna letter{'G'_rna4, '('_db3}; + seqan3::debug_stream << seqan3::to_rank(letter) << ' ' << seqan3::to_rank(get<0>(letter)) << ' ' << seqan3::to_rank(get<1>(letter)) << '\n'; - // 6 2 1 + // prints "7 2 1" seqan3::debug_stream << seqan3::to_char(letter) << ' ' << seqan3::to_char(get<0>(letter)) << ' ' << seqan3::to_char(get<1>(letter)) << '\n'; - // G G ( + // prints "G G ("" // modify via structured bindings and references: - auto & [ seq_l, structure_l ] = letter; - seq_l = 'U'_rna4; + auto & [ sequence_letter, structure_letter ] = letter; + sequence_letter = 'U'_rna4; seqan3::debug_stream << seqan3::to_char(letter) << '\n'; - // U + // prints "U" } diff --git a/test/snippet/alphabet/structure/wuss.cpp b/test/snippet/alphabet/structure/wuss.cpp new file mode 100644 index 0000000000..e771c1539b --- /dev/null +++ b/test/snippet/alphabet/structure/wuss.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main() +{ + using namespace seqan3::literals; + + seqan3::wuss51 letter{':'_wuss51}; + + letter.assign_char('~'); + seqan3::debug_stream << letter << '\n'; // prints "~" + + letter.assign_char('#'); // Unknown characters are implicitly converted to ';'. + seqan3::debug_stream << letter << '\n'; // prints ";" +} diff --git a/test/snippet/alphabet/structure/wuss_char_literal.cpp b/test/snippet/alphabet/structure/wuss_char_literal.cpp index 0eab8aef27..a9b51c5f27 100644 --- a/test/snippet/alphabet/structure/wuss_char_literal.cpp +++ b/test/snippet/alphabet/structure/wuss_char_literal.cpp @@ -2,10 +2,8 @@ int main() { - using seqan3::operator""_wuss51; + using namespace seqan3::literals; - // Using the char literal to assign a single WUSS character: - seqan3::wuss51 my_letter{'~'_wuss51}; - - my_letter.assign_char('<'); // <- assigns the char explicitly + seqan3::wuss51 letter1{'('_wuss51}; + auto letter2 = '('_wuss51; } diff --git a/test/snippet/alphabet/structure/wuss_general.cpp b/test/snippet/alphabet/structure/wuss_general.cpp deleted file mode 100644 index f91c12d654..0000000000 --- a/test/snippet/alphabet/structure/wuss_general.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -int main() -{ - using seqan3::operator""_wuss51; - - // create vector - std::vector vec{'.'_wuss51, '>'_wuss51, '>'_wuss51}; - // modify and print - vec[1] = '<'_wuss51; - for (seqan3::wuss51 chr : vec) - seqan3::debug_stream << seqan3::to_char(chr); // .<> - seqan3::debug_stream << "\n"; -} diff --git a/test/snippet/alphabet/structure/wuss_is_pair_close.cpp b/test/snippet/alphabet/structure/wuss_is_pair_close.cpp index 923a3f326a..381b7b38c8 100644 --- a/test/snippet/alphabet/structure/wuss_is_pair_close.cpp +++ b/test/snippet/alphabet/structure/wuss_is_pair_close.cpp @@ -2,7 +2,7 @@ int main() { - using seqan3::operator""_wuss51; + using namespace seqan3::literals; bool is_closing_char = '}'_wuss51.is_pair_close(); // true bool is_closing_char_alt = seqan3::is_pair_close('.'_wuss51); // false diff --git a/test/snippet/alphabet/structure/wuss_is_pair_open.cpp b/test/snippet/alphabet/structure/wuss_is_pair_open.cpp index d8a882b314..f03861122a 100644 --- a/test/snippet/alphabet/structure/wuss_is_pair_open.cpp +++ b/test/snippet/alphabet/structure/wuss_is_pair_open.cpp @@ -2,7 +2,7 @@ int main() { - using seqan3::operator""_wuss51; + using namespace seqan3::literals; bool is_opening_char = '{'_wuss51.is_pair_open(); // true bool is_opening_char_alt = seqan3::is_pair_open('.'_wuss51); // false diff --git a/test/snippet/alphabet/structure/wuss_is_unpaired.cpp b/test/snippet/alphabet/structure/wuss_is_unpaired.cpp index cc1b1c9f51..4d9ecdbb80 100644 --- a/test/snippet/alphabet/structure/wuss_is_unpaired.cpp +++ b/test/snippet/alphabet/structure/wuss_is_unpaired.cpp @@ -2,7 +2,7 @@ int main() { - using seqan3::operator""_wuss51; + using namespace seqan3::literals; bool is_unpaired_char = '.'_wuss51.is_unpaired(); // true bool is_unpaired_char_alt = seqan3::is_unpaired('{'_wuss51); // false diff --git a/test/snippet/alphabet/structure/wuss_literal.cpp b/test/snippet/alphabet/structure/wuss_literal.cpp index dcdfedc1bc..f9b6caf172 100644 --- a/test/snippet/alphabet/structure/wuss_literal.cpp +++ b/test/snippet/alphabet/structure/wuss_literal.cpp @@ -2,10 +2,9 @@ int main() { - using seqan3::operator""_wuss51; + using namespace seqan3::literals; - // Using the string literal to assign a vector of WUSS characters: - std::vector> foo{".<..>."_wuss51}; - std::vector> bar = ".<..>."_wuss51; - auto bax = ".<..>."_wuss51; + std::vector sequence1{".<..>."_wuss51}; + std::vector sequence2 = ".<..>."_wuss51; + auto sequence3 = ".<..>."_wuss51; } diff --git a/test/snippet/alphabet/structure/wuss_pseudoknot_id.cpp b/test/snippet/alphabet/structure/wuss_pseudoknot_id.cpp index e30e9bb771..61c08b2118 100644 --- a/test/snippet/alphabet/structure/wuss_pseudoknot_id.cpp +++ b/test/snippet/alphabet/structure/wuss_pseudoknot_id.cpp @@ -3,11 +3,11 @@ int main() { - using seqan3::operator""_wuss51; + using namespace seqan3::literals; auto pk_opt = '.'_wuss51.pseudoknot_id(); // std::optional -> false pk_opt = seqan3::pseudoknot_id('{'_wuss51); // std::optional -> true: 3 if (pk_opt) - seqan3::debug_stream << *pk_opt; // 3 + seqan3::debug_stream << *pk_opt << '\n'; // 3 } diff --git a/test/snippet/alphabet/to_char.cpp b/test/snippet/alphabet/to_char.cpp index 60fbdc78bf..5d5875876a 100644 --- a/test/snippet/alphabet/to_char.cpp +++ b/test/snippet/alphabet/to_char.cpp @@ -1,11 +1,11 @@ -#include #include +#include #include -using seqan3::operator""_dna5; - int main() { + using namespace seqan3::literals; + auto r2 = seqan3::to_char('A'); // calls seqan3::custom::to_char('A'); r2 == 'A' auto r3 = seqan3::to_char('A'_dna5); // calls .to_char() member; r3 == 'A' } diff --git a/test/snippet/alphabet/to_rank.cpp b/test/snippet/alphabet/to_rank.cpp index 52819952d3..4f4e6e9a49 100644 --- a/test/snippet/alphabet/to_rank.cpp +++ b/test/snippet/alphabet/to_rank.cpp @@ -1,11 +1,11 @@ -#include #include +#include #include -using seqan3::operator""_dna5; - int main() { + using namespace seqan3::literals; + auto r2 = seqan3::to_rank('A'); // calls seqan3::custom::to_rank('A'); r2 == 65 auto r3 = seqan3::to_rank('A'_dna5); // calls .to_char() member; r3 == 0 } diff --git a/test/snippet/alphabet/views/complement.cpp b/test/snippet/alphabet/views/complement.cpp index c552bf4d0d..23137aec19 100644 --- a/test/snippet/alphabet/views/complement.cpp +++ b/test/snippet/alphabet/views/complement.cpp @@ -5,7 +5,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::dna5_vector foo{"ACGTA"_dna5}; diff --git a/test/snippet/core/debug_stream_set_underlying_stream.cpp b/test/snippet/core/debug_stream_set_underlying_stream.cpp index 25fc1b7a46..f8d3427fbf 100644 --- a/test/snippet/core/debug_stream_set_underlying_stream.cpp +++ b/test/snippet/core/debug_stream_set_underlying_stream.cpp @@ -5,7 +5,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; std::ostringstream o; seqan3::debug_stream.set_underlying_stream(o); diff --git a/test/snippet/core/debug_stream_set_underlying_stream2.cpp b/test/snippet/core/debug_stream_set_underlying_stream2.cpp index 11789ef0e4..ed4700c024 100644 --- a/test/snippet/core/debug_stream_set_underlying_stream2.cpp +++ b/test/snippet/core/debug_stream_set_underlying_stream2.cpp @@ -5,7 +5,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; std::ostringstream o; seqan3::debug_stream_type my_stream{o}; diff --git a/test/snippet/core/debug_stream_usage.cpp b/test/snippet/core/debug_stream_usage.cpp index d2239844e4..5953eef98c 100644 --- a/test/snippet/core/debug_stream_usage.cpp +++ b/test/snippet/core/debug_stream_usage.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; // The alphabet normally needs to be converted to char explicitly: std::cout << seqan3::to_char('C'_dna5); // prints 'C' diff --git a/test/snippet/core/detail/persist_view.cpp b/test/snippet/core/detail/persist_view.cpp index 1cc7ff07a8..5f24a99305 100644 --- a/test/snippet/core/detail/persist_view.cpp +++ b/test/snippet/core/detail/persist_view.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; // explicitly create an l-value of our dna vector: auto vec = "ACGT"_dna4; diff --git a/test/snippet/core/detail/strong_type_new_usage.cpp b/test/snippet/core/detail/strong_type_new_usage.cpp index 11956dff5c..a284e94bdc 100644 --- a/test/snippet/core/detail/strong_type_new_usage.cpp +++ b/test/snippet/core/detail/strong_type_new_usage.cpp @@ -29,7 +29,7 @@ template int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector my_range = "ACGTT"_dna4; // do something diff --git a/test/snippet/core/detail/strong_type_usage.cpp b/test/snippet/core/detail/strong_type_usage.cpp index 0032bfd8d1..c48b61df60 100644 --- a/test/snippet/core/detail/strong_type_usage.cpp +++ b/test/snippet/core/detail/strong_type_usage.cpp @@ -18,7 +18,7 @@ bool search(fwd_rng_type & rng, unsigned const w, unsigned const e) int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector my_range = "ACGTT"_dna4; // do something diff --git a/test/snippet/io/record_2.cpp b/test/snippet/io/record_2.cpp index 1fd2ef070c..801344f573 100644 --- a/test/snippet/io/record_2.cpp +++ b/test/snippet/io/record_2.cpp @@ -8,7 +8,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; using seqan3::get; // The order of the types below represent a mapping between the type and the key. diff --git a/test/snippet/io/sam_file/get_cigar_vector.cpp b/test/snippet/io/sam_file/get_cigar_vector.cpp index e8b7c8c5b4..d768fd1972 100644 --- a/test/snippet/io/sam_file/get_cigar_vector.cpp +++ b/test/snippet/io/sam_file/get_cigar_vector.cpp @@ -6,7 +6,7 @@ int main() { using aligned_t = std::vector>; - using seqan3::operator""_dna4; + using namespace seqan3::literals; aligned_t ref{'A'_dna4, 'T'_dna4, 'G'_dna4, 'G'_dna4, seqan3::gap{}, seqan3::gap{}, 'C'_dna4, 'G'_dna4, 'T'_dna4, 'A'_dna4, 'G'_dna4, 'A'_dna4, 'G'_dna4, 'C'_dna4}; diff --git a/test/snippet/io/sam_file/sam_file_output_write_range.cpp b/test/snippet/io/sam_file/sam_file_output_write_range.cpp index f89645e3b6..f8c8492650 100644 --- a/test/snippet/io/sam_file/sam_file_output_write_range.cpp +++ b/test/snippet/io/sam_file/sam_file_output_write_range.cpp @@ -8,7 +8,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::sam_file_output fout{std::ostringstream{}, seqan3::format_sam{}}; diff --git a/test/snippet/io/sam_file/sam_tag_dictionary/general_usage.cpp b/test/snippet/io/sam_file/sam_tag_dictionary/general_usage.cpp index e64e571ca1..da51803486 100644 --- a/test/snippet/io/sam_file/sam_tag_dictionary/general_usage.cpp +++ b/test/snippet/io/sam_file/sam_tag_dictionary/general_usage.cpp @@ -3,8 +3,8 @@ int main() { - using seqan3::operator""_tag; - + using namespace seqan3::literals; + seqan3::sam_tag_dictionary dict{}; // initialise empty dictionary dict.get<"NM"_tag>() = 3; // set SAM tag 'NM' to 3 (integer type) diff --git a/test/snippet/io/sam_file/sam_tag_dictionary/sam_tag_dictionary.cpp b/test/snippet/io/sam_file/sam_tag_dictionary/sam_tag_dictionary.cpp index cdc37aae5c..bcecc914cc 100644 --- a/test/snippet/io/sam_file/sam_tag_dictionary/sam_tag_dictionary.cpp +++ b/test/snippet/io/sam_file/sam_tag_dictionary/sam_tag_dictionary.cpp @@ -1,7 +1,7 @@ //! [type_overload] #include -using seqan3::operator""_tag; +using namespace seqan3::literals; template <> // no template parameter since the tag is known struct seqan3::sam_tag_type<"XX"_tag> // here comes your tag @@ -13,7 +13,7 @@ struct seqan3::sam_tag_type<"XX"_tag> // here comes your tag //! [tag] #include -using seqan3::operator""_tag; +using namespace seqan3::literals; // ... @@ -24,7 +24,7 @@ uint16_t tag_id = "NM"_tag; // tag_id = 10061 //! [tag_type_t] #include -using seqan3::operator""_tag; +using namespace seqan3::literals; // ... @@ -35,7 +35,7 @@ using nm_tag_type = seqan3::sam_tag_type_t<"NM"_tag>; //! [tag_type] #include -using seqan3::operator""_tag; +using namespace seqan3::literals; // ... diff --git a/test/snippet/io/sam_file/sam_tag_dictionary/unknown_tag.cpp b/test/snippet/io/sam_file/sam_tag_dictionary/unknown_tag.cpp index 2cfe09396f..b2f57724df 100644 --- a/test/snippet/io/sam_file/sam_tag_dictionary/unknown_tag.cpp +++ b/test/snippet/io/sam_file/sam_tag_dictionary/unknown_tag.cpp @@ -23,7 +23,7 @@ auto print_fn = [] (auto && arg) int main() { - using seqan3::operator""_tag; + using namespace seqan3::literals; seqan3::sam_tag_dictionary dict{}; // initialise empty dictionary diff --git a/test/snippet/io/sequence_file/sequence_file_input_template_deduction.cpp b/test/snippet/io/sequence_file/sequence_file_input_template_deduction.cpp index d224c22888..e0d1e7d69d 100644 --- a/test/snippet/io/sequence_file/sequence_file_input_template_deduction.cpp +++ b/test/snippet/io/sequence_file/sequence_file_input_template_deduction.cpp @@ -5,7 +5,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; auto tmp_file = std::filesystem::temp_directory_path() / "my.fasta"; diff --git a/test/snippet/io/sequence_file/sequence_file_output_batch_write.cpp b/test/snippet/io/sequence_file/sequence_file_output_batch_write.cpp index a3e6b5b002..ca0c26ebf6 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_batch_write.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_batch_write.cpp @@ -8,7 +8,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}}; diff --git a/test/snippet/io/sequence_file/sequence_file_output_col_based_writing.cpp b/test/snippet/io/sequence_file/sequence_file_output_col_based_writing.cpp index d93101ed37..1303385b32 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_col_based_writing.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_col_based_writing.cpp @@ -7,7 +7,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; struct data_storage_t { diff --git a/test/snippet/io/sequence_file/sequence_file_output_cout_write.cpp b/test/snippet/io/sequence_file/sequence_file_output_cout_write.cpp index 67e0c38dc7..0e6e08888d 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_cout_write.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_cout_write.cpp @@ -5,7 +5,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::sequence_file_output fout{std::cout, seqan3::format_fasta{}}; // ^ no need to specify the template arguments diff --git a/test/snippet/io/sequence_file/sequence_file_output_emplace_back.cpp b/test/snippet/io/sequence_file/sequence_file_output_emplace_back.cpp index 7598e98a4f..9ed900791b 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_emplace_back.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_emplace_back.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}}; diff --git a/test/snippet/io/sequence_file/sequence_file_output_fields_trait_1.cpp b/test/snippet/io/sequence_file/sequence_file_output_fields_trait_1.cpp index f421104b80..c5dcd36d0d 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_fields_trait_1.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_fields_trait_1.cpp @@ -11,8 +11,7 @@ int main() { - using seqan3::operator""_dna5; - using seqan3::operator""_phred42; + using namespace seqan3::literals; seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fastq{}, diff --git a/test/snippet/io/sequence_file/sequence_file_output_push_back_record.cpp b/test/snippet/io/sequence_file/sequence_file_output_push_back_record.cpp index 90344546f6..6d004bee15 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_push_back_record.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_push_back_record.cpp @@ -7,7 +7,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}}; for(int i = 0; i < 5; ++i) // some criteria diff --git a/test/snippet/io/sequence_file/sequence_file_output_push_back_tuple.cpp b/test/snippet/io/sequence_file/sequence_file_output_push_back_tuple.cpp index 238dff0523..067f9664e6 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_push_back_tuple.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_push_back_tuple.cpp @@ -7,7 +7,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}}; diff --git a/test/snippet/io/sequence_file/sequence_file_output_range_interface.cpp b/test/snippet/io/sequence_file/sequence_file_output_range_interface.cpp index 6cfc605c6f..b6b7043eb3 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_range_interface.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_range_interface.cpp @@ -7,7 +7,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}}; diff --git a/test/snippet/io/sequence_file/sequence_file_output_record_wise_iteration.cpp b/test/snippet/io/sequence_file/sequence_file_output_record_wise_iteration.cpp index cd6038c3a3..270913ca45 100644 --- a/test/snippet/io/sequence_file/sequence_file_output_record_wise_iteration.cpp +++ b/test/snippet/io/sequence_file/sequence_file_output_record_wise_iteration.cpp @@ -7,7 +7,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}}; diff --git a/test/snippet/io/structure_file/structure_file_input_auto_temp_deduc.cpp b/test/snippet/io/structure_file/structure_file_input_auto_temp_deduc.cpp index faee868d62..6f6c950661 100644 --- a/test/snippet/io/structure_file/structure_file_input_auto_temp_deduc.cpp +++ b/test/snippet/io/structure_file/structure_file_input_auto_temp_deduc.cpp @@ -17,8 +17,7 @@ int main() { auto tmp_file = std::filesystem::temp_directory_path() / "my.dbn"; - using seqan3::operator""_rna4; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; // First, make /tmp/input.dbn { diff --git a/test/snippet/io/structure_file/structure_file_output_col_based.cpp b/test/snippet/io/structure_file/structure_file_output_col_based.cpp index 55f57c9037..fc53ecb82d 100644 --- a/test/snippet/io/structure_file/structure_file_output_col_based.cpp +++ b/test/snippet/io/structure_file/structure_file_output_col_based.cpp @@ -8,8 +8,7 @@ #include #include -using seqan3::operator""_rna5; -using seqan3::operator""_wuss51; +using namespace seqan3::literals; struct data_storage_t { diff --git a/test/snippet/io/structure_file/structure_file_output_emplace_back.cpp b/test/snippet/io/structure_file/structure_file_output_emplace_back.cpp index 2328ec0db4..eae45e88cb 100644 --- a/test/snippet/io/structure_file/structure_file_output_emplace_back.cpp +++ b/test/snippet/io/structure_file/structure_file_output_emplace_back.cpp @@ -8,8 +8,7 @@ int main() { - using seqan3::operator""_rna5; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structure_file_output fout{std::ostringstream{}, seqan3::format_vienna{}}; diff --git a/test/snippet/io/structure_file/structure_file_output_equal.cpp b/test/snippet/io/structure_file/structure_file_output_equal.cpp index 1b945fed8c..c822309c1c 100644 --- a/test/snippet/io/structure_file/structure_file_output_equal.cpp +++ b/test/snippet/io/structure_file/structure_file_output_equal.cpp @@ -9,8 +9,7 @@ int main() { - using seqan3::operator""_rna5; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structure_file_output fout{std::ostringstream{}, seqan3::format_vienna{}}; diff --git a/test/snippet/io/structure_file/structure_file_output_iter_by_rec.cpp b/test/snippet/io/structure_file/structure_file_output_iter_by_rec.cpp index 5107caf1b6..8f4c216ce6 100644 --- a/test/snippet/io/structure_file/structure_file_output_iter_by_rec.cpp +++ b/test/snippet/io/structure_file/structure_file_output_iter_by_rec.cpp @@ -9,8 +9,7 @@ int main() { - using seqan3::operator""_rna5; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structure_file_output fout{std::ostringstream{}, seqan3::format_vienna{}}; diff --git a/test/snippet/io/structure_file/structure_file_output_mult_rec.cpp b/test/snippet/io/structure_file/structure_file_output_mult_rec.cpp index 1b945fed8c..c822309c1c 100644 --- a/test/snippet/io/structure_file/structure_file_output_mult_rec.cpp +++ b/test/snippet/io/structure_file/structure_file_output_mult_rec.cpp @@ -9,8 +9,7 @@ int main() { - using seqan3::operator""_rna5; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structure_file_output fout{std::ostringstream{}, seqan3::format_vienna{}}; diff --git a/test/snippet/io/structure_file/structure_file_output_pipe_func.cpp b/test/snippet/io/structure_file/structure_file_output_pipe_func.cpp index f3a0c1e127..5aadfbf6ea 100644 --- a/test/snippet/io/structure_file/structure_file_output_pipe_func.cpp +++ b/test/snippet/io/structure_file/structure_file_output_pipe_func.cpp @@ -9,8 +9,7 @@ int main() { - using seqan3::operator""_rna5; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structure_file_output fout{std::ostringstream{}, seqan3::format_vienna{}}; diff --git a/test/snippet/io/structure_file/structure_file_output_push_back.cpp b/test/snippet/io/structure_file/structure_file_output_push_back.cpp index 161ad3caf4..96ceefdd2a 100644 --- a/test/snippet/io/structure_file/structure_file_output_push_back.cpp +++ b/test/snippet/io/structure_file/structure_file_output_push_back.cpp @@ -9,8 +9,7 @@ int main() { - using seqan3::operator""_rna5; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structure_file_output fout{std::ostringstream{}, seqan3::format_vienna{}}; diff --git a/test/snippet/io/structure_file/structure_file_output_push_back_2.cpp b/test/snippet/io/structure_file/structure_file_output_push_back_2.cpp index 6b7109c027..7133c5e871 100644 --- a/test/snippet/io/structure_file/structure_file_output_push_back_2.cpp +++ b/test/snippet/io/structure_file/structure_file_output_push_back_2.cpp @@ -9,8 +9,7 @@ int main() { - using seqan3::operator""_rna5; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structure_file_output fout{std::ostringstream{}, seqan3::format_vienna{}}; diff --git a/test/snippet/io/structure_file/structure_file_output_write_fields.cpp b/test/snippet/io/structure_file/structure_file_output_write_fields.cpp index 940bd49611..3a19c56df2 100644 --- a/test/snippet/io/structure_file/structure_file_output_write_fields.cpp +++ b/test/snippet/io/structure_file/structure_file_output_write_fields.cpp @@ -10,8 +10,7 @@ int main() { - using seqan3::operator""_rna5; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structured_rna sr{'G'_rna5, '.'_wuss51}; diff --git a/test/snippet/io/structure_file/structure_file_output_write_std_out.cpp b/test/snippet/io/structure_file/structure_file_output_write_std_out.cpp index ded3dfc66c..842d1f0912 100644 --- a/test/snippet/io/structure_file/structure_file_output_write_std_out.cpp +++ b/test/snippet/io/structure_file/structure_file_output_write_std_out.cpp @@ -6,8 +6,7 @@ int main() { - using seqan3::operator""_rna4; - using seqan3::operator""_wuss51; + using namespace seqan3::literals; seqan3::structure_file_output fout{std::cout, seqan3::format_vienna{}}; // ^ no need to specify the template arguments diff --git a/test/snippet/range/container/bitcompressed_vector.cpp b/test/snippet/range/container/bitcompressed_vector.cpp index 0f7367bb09..459326adfe 100644 --- a/test/snippet/range/container/bitcompressed_vector.cpp +++ b/test/snippet/range/container/bitcompressed_vector.cpp @@ -5,7 +5,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector v0{"ACGT"_dna4}; // data occupies 4 bytes in memory seqan3::bitcompressed_vector v1{"ACGT"_dna4}; // data occupies 1 byte in memory diff --git a/test/snippet/range/container/concatenated_sequences.cpp b/test/snippet/range/container/concatenated_sequences.cpp index 17711fefec..1f41f4c5c3 100644 --- a/test/snippet/range/container/concatenated_sequences.cpp +++ b/test/snippet/range/container/concatenated_sequences.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::concatenated_sequences concat1{"ACGT"_dna4, "GAGGA"_dna4}; seqan3::debug_stream << concat1[0] << '\n'; // "ACGT" diff --git a/test/snippet/range/container/concatenated_sequences_insert.cpp b/test/snippet/range/container/concatenated_sequences_insert.cpp index d08af5c8ec..2b2dabbae5 100644 --- a/test/snippet/range/container/concatenated_sequences_insert.cpp +++ b/test/snippet/range/container/concatenated_sequences_insert.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::concatenated_sequences foobar; foobar.insert(foobar.end(), "ACGT"_dna4); diff --git a/test/snippet/range/container/concatenated_sequences_insert2.cpp b/test/snippet/range/container/concatenated_sequences_insert2.cpp index 736cd5393a..add2611a75 100644 --- a/test/snippet/range/container/concatenated_sequences_insert2.cpp +++ b/test/snippet/range/container/concatenated_sequences_insert2.cpp @@ -4,8 +4,8 @@ int main() { - using seqan3::operator""_dna4; - + using namespace seqan3::literals; + seqan3::concatenated_sequences foobar; foobar.insert(foobar.end(), 2, "ACGT"_dna4); seqan3::debug_stream << foobar[0] << '\n'; // "ACGT" diff --git a/test/snippet/range/views/range_view_all_composability.cpp b/test/snippet/range/views/range_view_all_composability.cpp index b46a874901..2b037fde0a 100644 --- a/test/snippet/range/views/range_view_all_composability.cpp +++ b/test/snippet/range/views/range_view_all_composability.cpp @@ -5,7 +5,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::dna4_vector vec{"ACGGTC"_dna4}; // views can be composed iteratively diff --git a/test/snippet/range/views/range_view_all_notation.cpp b/test/snippet/range/views/range_view_all_notation.cpp index 3dcd0a91ad..a302ec6c3c 100644 --- a/test/snippet/range/views/range_view_all_notation.cpp +++ b/test/snippet/range/views/range_view_all_notation.cpp @@ -3,7 +3,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::dna4_vector vec{"ACGGTC"_dna4}; diff --git a/test/snippet/range/views/range_view_all_retransform.cpp b/test/snippet/range/views/range_view_all_retransform.cpp index 0c4e1b758f..eeff017676 100644 --- a/test/snippet/range/views/range_view_all_retransform.cpp +++ b/test/snippet/range/views/range_view_all_retransform.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::dna4_vector vec{"ACGGTC"_dna4}; auto vec_view2 = seqan3::views::complement(vec); diff --git a/test/snippet/range/views/range_view_to_char.cpp b/test/snippet/range/views/range_view_to_char.cpp index 49d8515be1..9ea9b310d2 100644 --- a/test/snippet/range/views/range_view_to_char.cpp +++ b/test/snippet/range/views/range_view_to_char.cpp @@ -8,8 +8,7 @@ int main() { - using seqan3::operator""_dna4; - using seqan3::operator""_phred42; + using namespace seqan3::literals; seqan3::dna4_vector vec = "ACTTTGATA"_dna4; auto v = vec | seqan3::views::to_char; diff --git a/test/snippet/range/views/range_view_to_rank.cpp b/test/snippet/range/views/range_view_to_rank.cpp index c4bc05b3b4..5ed5870193 100644 --- a/test/snippet/range/views/range_view_to_rank.cpp +++ b/test/snippet/range/views/range_view_to_rank.cpp @@ -8,8 +8,7 @@ int main() { - using seqan3::operator""_dna4; - using seqan3::operator""_phred42; + using namespace seqan3::literals; seqan3::dna4_vector vec = "ACTTTGATA"_dna4; auto v = vec | seqan3::views::to_rank; diff --git a/test/snippet/range/views/translate_dna5.cpp b/test/snippet/range/views/translate_dna5.cpp index 85edeb16b3..4c855905ce 100644 --- a/test/snippet/range/views/translate_dna5.cpp +++ b/test/snippet/range/views/translate_dna5.cpp @@ -5,7 +5,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::dna5_vector vec{"ACGTACGTACGTA"_dna5}; diff --git a/test/snippet/range/views/translate_join.cpp b/test/snippet/range/views/translate_join.cpp index ee9798bfb0..8879d83335 100644 --- a/test/snippet/range/views/translate_join.cpp +++ b/test/snippet/range/views/translate_join.cpp @@ -6,7 +6,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/range/views/translate_usage.cpp b/test/snippet/range/views/translate_usage.cpp index 5357584a27..c0f771f1bf 100644 --- a/test/snippet/range/views/translate_usage.cpp +++ b/test/snippet/range/views/translate_usage.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; seqan3::dna5_vector vec{"ACGTACGTACGTA"_dna5}; diff --git a/test/snippet/range/views/trim_quality_dna5q.cpp b/test/snippet/range/views/trim_quality_dna5q.cpp index a53daaba2b..6795aedd38 100644 --- a/test/snippet/range/views/trim_quality_dna5q.cpp +++ b/test/snippet/range/views/trim_quality_dna5q.cpp @@ -9,8 +9,7 @@ int main() { - using seqan3::operator""_dna5; - using seqan3::operator""_phred42; + using namespace seqan3::literals; std::vector vec{{'A'_dna5, 'I'_phred42}, {'G'_dna5, 'I'_phred42}, diff --git a/test/snippet/range/views/trim_quality_phred42.cpp b/test/snippet/range/views/trim_quality_phred42.cpp index 63b55cedd1..dad15b2215 100644 --- a/test/snippet/range/views/trim_quality_phred42.cpp +++ b/test/snippet/range/views/trim_quality_phred42.cpp @@ -5,7 +5,7 @@ #include #include -using seqan3::operator""_phred42; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/search/bi_fm_index.cpp b/test/snippet/search/bi_fm_index.cpp index 53ec620f46..1edeac4739 100644 --- a/test/snippet/search/bi_fm_index.cpp +++ b/test/snippet/search/bi_fm_index.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector genome{"ATCGATCGAAGGCTAGCTAGCTAAGGGA"_dna4}; seqan3::bi_fm_index index{genome}; // build the index diff --git a/test/snippet/search/bi_fm_index_collection.cpp b/test/snippet/search/bi_fm_index_collection.cpp index 644d534ce9..a8ad6c2498 100644 --- a/test/snippet/search/bi_fm_index_collection.cpp +++ b/test/snippet/search/bi_fm_index_collection.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector> genomes{"ATCTGACGAAGGCTAGCTAGCTAAGGGA"_dna4, "TAGCTGAAGCCATTGGCATCTGATCGGACT"_dna4, "ACTGAGCTCGTC"_dna4, diff --git a/test/snippet/search/bi_fm_index_cursor_cycle.cpp b/test/snippet/search/bi_fm_index_cursor_cycle.cpp index 23c9e8e867..7d80290bfa 100644 --- a/test/snippet/search/bi_fm_index_cursor_cycle.cpp +++ b/test/snippet/search/bi_fm_index_cursor_cycle.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::debug_stream << "Example cycle_back() and cycle_front()\n"; diff --git a/test/snippet/search/bi_fm_index_cursor_extend_left_seq.cpp b/test/snippet/search/bi_fm_index_cursor_extend_left_seq.cpp index 0d0208fa05..8cfd15c7d1 100644 --- a/test/snippet/search/bi_fm_index_cursor_extend_left_seq.cpp +++ b/test/snippet/search/bi_fm_index_cursor_extend_left_seq.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::debug_stream << "Example extend_left(seq)\n"; diff --git a/test/snippet/search/bi_fm_index_cursor_to_fwd_cursor.cpp b/test/snippet/search/bi_fm_index_cursor_to_fwd_cursor.cpp index 87cce7d43e..fe9976299f 100644 --- a/test/snippet/search/bi_fm_index_cursor_to_fwd_cursor.cpp +++ b/test/snippet/search/bi_fm_index_cursor_to_fwd_cursor.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::debug_stream << "Example to_fwd_cursor()\n"; diff --git a/test/snippet/search/dream_index/counting_agent.cpp b/test/snippet/search/dream_index/counting_agent.cpp index f0da50afaa..6ea4cd052f 100644 --- a/test/snippet/search/dream_index/counting_agent.cpp +++ b/test/snippet/search/dream_index/counting_agent.cpp @@ -3,7 +3,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/search/dream_index/interleaved_bloom_filter_clear.cpp b/test/snippet/search/dream_index/interleaved_bloom_filter_clear.cpp index 67dd73021b..3ccc2fa2f8 100644 --- a/test/snippet/search/dream_index/interleaved_bloom_filter_clear.cpp +++ b/test/snippet/search/dream_index/interleaved_bloom_filter_clear.cpp @@ -3,7 +3,7 @@ #include #include -using seqan3::operator""_dna4; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/search/fm_index.cpp b/test/snippet/search/fm_index.cpp index f909020177..b0be2fac94 100644 --- a/test/snippet/search/fm_index.cpp +++ b/test/snippet/search/fm_index.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector genome{"ATCGATCGAAGGCTAGCTAGCTAAGGGA"_dna4}; seqan3::fm_index index{genome}; // build the index diff --git a/test/snippet/search/fm_index_collection.cpp b/test/snippet/search/fm_index_collection.cpp index 3d96163606..93ecd123e7 100644 --- a/test/snippet/search/fm_index_collection.cpp +++ b/test/snippet/search/fm_index_collection.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector> genomes{"ATCTGACGAAGGCTAGCTAGCTAAGGGA"_dna4, "TAGCTGAAGCCATTGGCATCTGATCGGACT"_dna4, diff --git a/test/snippet/search/fm_index_cursor.cpp b/test/snippet/search/fm_index_cursor.cpp index 79b483bb20..6a50e34bb9 100644 --- a/test/snippet/search/fm_index_cursor.cpp +++ b/test/snippet/search/fm_index_cursor.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector genome{"AATAATAAC"_dna4}; seqan3::fm_index index{genome}; // build the index diff --git a/test/snippet/search/kmer_index/shape.cpp b/test/snippet/search/kmer_index/shape.cpp index 1858651a11..7abe25c2a6 100644 --- a/test/snippet/search/kmer_index/shape.cpp +++ b/test/snippet/search/kmer_index/shape.cpp @@ -2,7 +2,7 @@ #include // For seqan3::shape #include // For std::ranges::size() -using seqan3::operator""_shape; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/search/search.cpp b/test/snippet/search/search.cpp index bea79c9ce6..6bbbdfad93 100644 --- a/test/snippet/search/search.cpp +++ b/test/snippet/search/search.cpp @@ -7,7 +7,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector genomes{"CGCTGTCTGAAGGATGAGTGTCAGCCAGTGTA"_dna4, "ACCCGATGAGCTACCCAGTAGTCGAACTG"_dna4, "GGCCAGACAACCCGGCGCTAATGCACTCA"_dna4}; diff --git a/test/snippet/search/search_with_user_callback.cpp b/test/snippet/search/search_with_user_callback.cpp index d59e2d52a4..78ee03ce59 100644 --- a/test/snippet/search/search_with_user_callback.cpp +++ b/test/snippet/search/search_with_user_callback.cpp @@ -7,7 +7,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; std::vector genomes{"CGCTGTCTGAAGGATGAGTGTCAGCCAGTGTA"_dna4, "ACCCGATGAGCTACCCAGTAGTCGAACTG"_dna4, "GGCCAGACAACCCGGCGCTAATGCACTCA"_dna4}; diff --git a/test/snippet/search/views/kmer_hash.cpp b/test/snippet/search/views/kmer_hash.cpp index b3b46f3576..cfa7c8369a 100644 --- a/test/snippet/search/views/kmer_hash.cpp +++ b/test/snippet/search/views/kmer_hash.cpp @@ -2,8 +2,7 @@ #include #include -using seqan3::operator""_dna4; -using seqan3::operator""_shape; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/search/views/minimiser.cpp b/test/snippet/search/views/minimiser.cpp index 93811b4be7..15bed670ca 100644 --- a/test/snippet/search/views/minimiser.cpp +++ b/test/snippet/search/views/minimiser.cpp @@ -4,8 +4,7 @@ #include #include -using seqan3::operator""_dna4; -using seqan3::operator""_shape; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/search/views/minimiser_hash.cpp b/test/snippet/search/views/minimiser_hash.cpp index 81ad7e64a8..caa1dccc61 100644 --- a/test/snippet/search/views/minimiser_hash.cpp +++ b/test/snippet/search/views/minimiser_hash.cpp @@ -2,8 +2,7 @@ #include #include -using seqan3::operator""_dna4; -using seqan3::operator""_shape; +using namespace seqan3::literals; int main() { diff --git a/test/snippet/std/view/subrange.cpp b/test/snippet/std/view/subrange.cpp index f93c2fb9dc..4a1a81fbd1 100644 --- a/test/snippet/std/view/subrange.cpp +++ b/test/snippet/std/view/subrange.cpp @@ -6,7 +6,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; seqan3::dna4_vector s{"ACTTTGATAA"_dna4}; using iterator = seqan3::dna4_vector::iterator; auto v1 = std::ranges::subrange{std::ranges::begin(s) + 2, std::ranges::end(s)} diff --git a/test/snippet/utility/simd/views/to_simd.cpp b/test/snippet/utility/simd/views/to_simd.cpp index d6f46d5465..b367d61468 100644 --- a/test/snippet/utility/simd/views/to_simd.cpp +++ b/test/snippet/utility/simd/views/to_simd.cpp @@ -8,7 +8,7 @@ using uint16x8_t = seqan3::simd_type_t; int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; // Adds 7 sequences. The eighth will be set to a default value. std::vector batch; diff --git a/test/snippet/utility/views/convert_15_to_5.cpp b/test/snippet/utility/views/convert_15_to_5.cpp index 9a1bfb2fb1..952c978712 100644 --- a/test/snippet/utility/views/convert_15_to_5.cpp +++ b/test/snippet/utility/views/convert_15_to_5.cpp @@ -4,7 +4,7 @@ int main() { - using seqan3::operator""_dna15; + using namespace seqan3::literals; seqan3::dna15_vector vec2{"ACYGTN"_dna15}; auto v4 = vec2 | seqan3::views::convert; // == "ACNGTN"_dna5 diff --git a/test/snippet/utility/views/deep_no_param.cpp b/test/snippet/utility/views/deep_no_param.cpp index 387b61c24f..82eb33f15c 100644 --- a/test/snippet/utility/views/deep_no_param.cpp +++ b/test/snippet/utility/views/deep_no_param.cpp @@ -12,7 +12,7 @@ inline auto const deep_reverse = seqan3::views::deep{std::views::reverse}; int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; std::vector foo{"AAATTT"_dna5, "CCCGGG"_dna5}; diff --git a/test/snippet/utility/views/deep_pass_ref.cpp b/test/snippet/utility/views/deep_pass_ref.cpp index 2a83ef9cc9..8cae12045b 100644 --- a/test/snippet/utility/views/deep_pass_ref.cpp +++ b/test/snippet/utility/views/deep_pass_ref.cpp @@ -11,7 +11,7 @@ inline auto const deep_take = seqan3::views::deep{std::views::take}; int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; std::vector foo{"AAATTT"_dna5, "CCCGGG"_dna5}; diff --git a/test/snippet/utility/views/deep_with_param.cpp b/test/snippet/utility/views/deep_with_param.cpp index 78fbb8ecd2..f7c9594079 100644 --- a/test/snippet/utility/views/deep_with_param.cpp +++ b/test/snippet/utility/views/deep_with_param.cpp @@ -11,7 +11,7 @@ inline auto const deep_take = seqan3::views::deep{std::views::take}; int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; std::vector foo{"AAATTT"_dna5, "CCCGGG"_dna5}; diff --git a/test/snippet/utility/views/deep_wrap_args.cpp b/test/snippet/utility/views/deep_wrap_args.cpp index 6137add82f..5a396984c9 100644 --- a/test/snippet/utility/views/deep_wrap_args.cpp +++ b/test/snippet/utility/views/deep_wrap_args.cpp @@ -11,7 +11,7 @@ inline auto const deep_take1 = seqan3::views::deep{std::views::take(1)}; int main() { - using seqan3::operator""_dna5; + using namespace seqan3::literals; std::vector foo{"AAATTT"_dna5, "CCCGGG"_dna5}; diff --git a/test/snippet/utility/views/elements.cpp b/test/snippet/utility/views/elements.cpp index 7ae0e0f8ea..2df380fca9 100644 --- a/test/snippet/utility/views/elements.cpp +++ b/test/snippet/utility/views/elements.cpp @@ -9,8 +9,7 @@ int main() { - using seqan3::operator""_dna4; - using seqan3::operator""_phred42; + using namespace seqan3::literals; // Create a vector of dna4 quality composite alphabet. std::vector qv{{'A'_dna4, '0'_phred42}, diff --git a/test/snippet/utility/views/enforce_random_access.cpp b/test/snippet/utility/views/enforce_random_access.cpp index 0f50cf6cab..a7e19d15fc 100644 --- a/test/snippet/utility/views/enforce_random_access.cpp +++ b/test/snippet/utility/views/enforce_random_access.cpp @@ -7,7 +7,7 @@ int main() { - using seqan3::operator""_dna4; + using namespace seqan3::literals; // A gap decorator is a pseudo random access range using logarithmic time complexity internally. auto seq = "ACGTACGACT"_dna4;