diff --git a/CHANGELOG.md b/CHANGELOG.md index 887e1ae70b..4c95be197e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -199,6 +199,9 @@ regression test suite and patches at https://github.com/seqan/seqan3/tree/master * We made `seqan3::views::convert` NOAPI and moved it to `seqan3/utility/views/convert.hpp`. You can still use `seqan3::views::convert` in the meantime, but we encourage using `std::views::transform` instead as shown in our [Cookbook](https://docs.seqan.de/seqan/3.0.3/cookbook.html#cookbook_convert_alphabet_range). +* We deprecated `seqan3::views::to_upper` and it will be removed in 3.1.0, use + `std::views::transform([](auto && chr){return std::toupper(chr)})`. + ([\#2540](https://github.com/seqan/seqan3/pull/2538)) #### Search diff --git a/include/seqan3/range/views/to_upper.hpp b/include/seqan3/range/views/to_upper.hpp index f5d54854db..3fc1bba1a7 100644 --- a/include/seqan3/range/views/to_upper.hpp +++ b/include/seqan3/range/views/to_upper.hpp @@ -7,7 +7,7 @@ /*!\file * \author Tobias Loka - * \brief Provides seqan3::views::to_upper. + * \brief [DEPRECATED] Provides seqan3::views::to_upper. */ #pragma once @@ -63,13 +63,17 @@ namespace seqan3::views * ### Example * \include test/snippet/range/views/to_upper.cpp * \hideinitializer + * + * \deprecated Use std::views::transform([](auto && chr){return std::toupper(chr)}); */ -inline auto const to_upper = deep{std::views::transform([] (auto const in) noexcept +#ifdef SEQAN3_DEPRECATED_310 +SEQAN3_DEPRECATED_310 inline auto const to_upper = deep{std::views::transform([] (auto const in) noexcept { static_assert(builtin_character>, - "The value type of seqan3::views::to_upper must model the seqan3::builtin_character."); + "The value type of seqan3::views::to_upper must model the seqan3::builtin_character."); return seqan3::to_upper(in); })}; +#endif // SEQAN3_DEPRECATED_310 //!\} diff --git a/test/snippet/range/views/to_upper.cpp b/test/snippet/range/views/to_upper.cpp index b08472e9ad..212faf235e 100644 --- a/test/snippet/range/views/to_upper.cpp +++ b/test/snippet/range/views/to_upper.cpp @@ -1,3 +1,6 @@ +#ifdef SEQAN3_DEPRECATED_310 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include #include @@ -14,3 +17,5 @@ int main() seqan3::debug_stream << v1 << '\n'; // => "CHANGED!" seqan3::debug_stream << v2 << '\n'; // => ["CHANGED", "UNCHANGED!"] } +#pragma GCC diagnostic pop +#endif // SEQAN3_DEPRECATED_310 diff --git a/test/unit/range/views/to_upper_test.cpp b/test/unit/range/views/to_upper_test.cpp index 5eb7f4636b..99429191aa 100644 --- a/test/unit/range/views/to_upper_test.cpp +++ b/test/unit/range/views/to_upper_test.cpp @@ -15,6 +15,9 @@ #include #include +#ifdef SEQAN3_DEPRECATED_310 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" using seqan3::operator""_dna5; @@ -95,3 +98,5 @@ TEST(view_to_upper, concepts) EXPECT_FALSE((std::ranges::output_range)); EXPECT_FALSE(std::ranges::contiguous_range); } +#pragma GCC diagnostic pop +#endif // SEQAN3_DEPRECATED_310