seqan / product_backlog

This repository is used as product backlog for all SeqAn relevant backlog items. This is intended to organise the work for the team.
2 stars 1 forks source link

deprecate seqan3::views::drop #325

Closed marehr closed 3 years ago

marehr commented 3 years ago

Tasks

From 544fb94433bb2d5b6d7891dea251a1598a7e67ff Mon Sep 17 00:00:00 2001
From: marehr <marehr-github@marehr.dialup.fu-berlin.de>
Date: Sun, 18 Apr 2021 12:47:48 +0200
Subject: [PATCH 03/35] TODO: [MISC] deprecate seqan3::views::drop

---
 include/seqan3/range/views/drop.hpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/seqan3/range/views/drop.hpp b/include/seqan3/range/views/drop.hpp
index 87b5fb891..d1fc4ae39 100644
--- a/include/seqan3/range/views/drop.hpp
+++ b/include/seqan3/range/views/drop.hpp
@@ -54,6 +54,7 @@ struct drop_fn
         // safeguard against wrong size
         if constexpr (std::ranges::sized_range<urng_t>)
         {
+            // in standard
             size_t urange_size = std::ranges::size(urange);
             drop_size = std::min(drop_size, urange_size);
             new_size = urange_size - drop_size;
@@ -62,12 +63,14 @@ struct drop_fn
         // string_view
         if constexpr (is_type_specialisation_of_v<std::remove_cvref_t<urng_t>, std::basic_string_view>)
         {
+            // in standard
             return urange.substr(drop_size);
         }
         // string const &
         else if constexpr (is_type_specialisation_of_v<std::remove_cvref_t<urng_t>, std::basic_string> &&
                            std::is_const_v<std::remove_reference_t<urng_t>>)
         {
+            // not in standard
             return std::basic_string_view{std::ranges::data(urange) + drop_size, new_size};
         }
         // contiguous
@@ -75,6 +78,7 @@ struct drop_fn
                            std::ranges::contiguous_range<urng_t> &&
                            std::ranges::sized_range<urng_t>)
         {
+            // in standard
             return std::span{std::ranges::data(urange) + drop_size, new_size};
         }
         // random_access
@@ -82,6 +86,7 @@ struct drop_fn
                            std::ranges::random_access_range<urng_t> &&
                            std::ranges::sized_range<urng_t>)
         {
+            // not in standard
             return std::ranges::subrange<std::ranges::iterator_t<urng_t>, std::ranges::iterator_t<urng_t>>
             {
                 std::ranges::begin(urange) + drop_size,
@@ -166,6 +171,8 @@ namespace seqan3::views
  * \include test/snippet/range/views/drop.cpp
  *
  * \hideinitializer
+ *
+ * \deprecated Use std::views::drop or seqan3::views::type_reduce | std::views::drop.
  */
 inline constexpr auto drop = detail::drop_fn{};

-- 
2.31.1