Skip to content

Commit

Permalink
[MISC] Rename seqan::std to seqan::stl
Browse files Browse the repository at this point in the history
For now. seqan::std causes lookups to fail
  • Loading branch information
eseiler committed Aug 24, 2023
1 parent b072b55 commit e78c97f
Show file tree
Hide file tree
Showing 16 changed files with 305 additions and 305 deletions.
34 changes: 17 additions & 17 deletions include/hibf/contrib/std/all_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/*!\file
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de>
* \brief Provides seqan::std::views::{all, all_t}, and seqan::std::ranges::owning_view.
* \brief Provides seqan::stl::views::{all, all_t}, and seqan::stl::ranges::owning_view.
*/

// File might be included from multiple libraries.
Expand All @@ -18,33 +18,33 @@

#if __cpp_lib_ranges >= 202110L

namespace seqan::std::ranges
namespace seqan::stl::ranges
{

using ::std::ranges::owning_view;

} // namespace seqan::std::ranges
} // namespace seqan::stl::ranges

namespace seqan::std::views
namespace seqan::stl::views
{

using ::std::ranges::views::all;
using ::std::ranges::views::all_t;

} // namespace seqan::std::views
} // namespace seqan::stl::views
#else
# include "concepts.hpp"
# include "detail/adaptor_base.hpp"
# include "detail/exposition_only.hpp"

namespace seqan::std::ranges
namespace seqan::stl::ranges
{

/*!\brief A move-only view that takes unique ownership of a range.
* \sa https://en.cppreference.com/w/cpp/ranges/owning_view
*/
template <::std::ranges::range rng_t>
requires ::std::movable<rng_t> && (!seqan::std::detail::is_initializer_list<::std::remove_cvref_t<rng_t>>)
requires ::std::movable<rng_t> && (!seqan::stl::detail::is_initializer_list<::std::remove_cvref_t<rng_t>>)
class owning_view : public ::std::ranges::view_interface<owning_view<rng_t>>
{
private:
Expand Down Expand Up @@ -158,13 +158,13 @@ class owning_view : public ::std::ranges::view_interface<owning_view<rng_t>>
}
};

/*!\brief The functor for seqan::std::views::all.
/*!\brief The functor for seqan::stl::views::all.
*/
class all_fn : public seqan::std::detail::adaptor_base<all_fn>
class all_fn : public seqan::stl::detail::adaptor_base<all_fn>
{
private:
//!\brief Befriend the base class.
friend seqan::std::detail::adaptor_base<all_fn>;
friend seqan::stl::detail::adaptor_base<all_fn>;

//!\brief Checks whether a type is a view.
template <typename t>
Expand All @@ -179,7 +179,7 @@ class all_fn : public seqan::std::detail::adaptor_base<all_fn>
static constexpr bool valid_for_owning_view = requires { owning_view(::std::declval<t>()); };

public:
using seqan::std::detail::adaptor_base<all_fn>::adaptor_base;
using seqan::stl::detail::adaptor_base<all_fn>::adaptor_base;

/*!\brief Returns a view that includes all elements of the range argument.
* \sa https://en.cppreference.com/w/cpp/ranges/all_view
Expand All @@ -191,7 +191,7 @@ class all_fn : public seqan::std::detail::adaptor_base<all_fn>
* * A ::std::ranges::ref_view of `rng` if that expression is valid.
* * Otherwise, a seqan3::detail::owning_view of `rng`.
*/
template <seqan::std::ranges::viewable_range rng_t>
template <seqan::stl::ranges::viewable_range rng_t>
requires decays_to_view<rng_t> || valid_for_ref_view<rng_t> || valid_for_owning_view<rng_t>
static auto impl(rng_t && rng)
{
Expand All @@ -204,21 +204,21 @@ class all_fn : public seqan::std::detail::adaptor_base<all_fn>
}
};

} // namespace seqan::std::ranges
} // namespace seqan::stl::ranges

namespace seqan::std::views
namespace seqan::stl::views
{

/*!\copydoc all_fn::impl
*/
inline constexpr auto all = seqan::std::ranges::all_fn{};
inline constexpr auto all = seqan::stl::ranges::all_fn{};

/*!\brief Returns the type that results from appying seqan3::detail::all to a range.
*/
template <seqan::std::ranges::viewable_range rng_t>
template <seqan::stl::ranges::viewable_range rng_t>
using all_t = decltype(all(::std::declval<rng_t>()));

} // namespace seqan::std::views
} // namespace seqan::stl::views

#endif // __cpp_lib_ranges >= 202110L

Expand Down
58 changes: 29 additions & 29 deletions include/hibf/contrib/std/chunk_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/*!\file
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de>
* \brief Provides seqan::std::views::chunk.
* \brief Provides seqan::stl::views::chunk.
*/

// File might be included from multiple libraries.
Expand All @@ -18,12 +18,12 @@

#ifdef __cpp_lib_ranges_chunk

namespace seqan::std::views
namespace seqan::stl::views
{

using ::std::ranges::views::chunk;

} // namespace seqan::std::views
} // namespace seqan::stl::views

#else

Expand All @@ -37,7 +37,7 @@ using ::std::ranges::views::chunk;
# include "detail/exposition_only.hpp"
# include "detail/non_propagating_cache.hpp"

namespace seqan::std::detail::chunk
namespace seqan::stl::detail::chunk
{

template <class I>
Expand All @@ -55,9 +55,9 @@ constexpr auto to_unsigned_like(T v) noexcept
return static_cast<::std::make_unsigned_t<T>>(v);
}

} // namespace seqan::std::detail::chunk
} // namespace seqan::stl::detail::chunk

namespace seqan::std::ranges
namespace seqan::stl::ranges
{

template <::std::ranges::view V>
Expand All @@ -74,7 +74,7 @@ SEQAN_STD_NESTED_VISIBILITY
::std::ranges::range_difference_t<V> n_;
::std::ranges::range_difference_t<V> remainder_ = 0;

seqan::std::detail::non_propagating_cache<::std::ranges::iterator_t<V>> current_;
seqan::stl::detail::non_propagating_cache<::std::ranges::iterator_t<V>> current_;

private:
class outer_iterator;
Expand Down Expand Up @@ -115,19 +115,19 @@ SEQAN_STD_NESTED_VISIBILITY
constexpr auto size()
requires ::std::ranges::sized_range<V>
{
return seqan::std::detail::chunk::to_unsigned_like(
seqan::std::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
return seqan::stl::detail::chunk::to_unsigned_like(
seqan::stl::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
}
constexpr auto size() const
requires ::std::ranges::sized_range<V const>
{
return seqan::std::detail::chunk::to_unsigned_like(
seqan::std::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
return seqan::stl::detail::chunk::to_unsigned_like(
seqan::stl::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
}
};

template <class R>
chunk_view(R &&, ::std::ranges::range_difference_t<R>) -> chunk_view<seqan::std::views::all_t<R>>;
chunk_view(R &&, ::std::ranges::range_difference_t<R>) -> chunk_view<seqan::stl::views::all_t<R>>;

template <::std::ranges::view V>
requires ::std::ranges::input_range<V>
Expand Down Expand Up @@ -180,7 +180,7 @@ class chunk_view<V>::outer_iterator
{
return dist == 0 ? 0 : 1;
}
return seqan::std::detail::chunk::div_ceil(dist - x.parent_->remainder_, x.parent_->n_) + 1;
return seqan::stl::detail::chunk::div_ceil(dist - x.parent_->remainder_, x.parent_->n_) + 1;
}
friend constexpr difference_type operator-(outer_iterator const & x, ::std::default_sentinel_t y)
requires ::std::sized_sentinel_for<::std::ranges::sentinel_t<V>, ::std::ranges::iterator_t<V>>
Expand Down Expand Up @@ -214,7 +214,7 @@ struct chunk_view<V>::outer_iterator::value_type : ::std::ranges::view_interface
constexpr auto size() const
requires ::std::sized_sentinel_for<::std::ranges::sentinel_t<V>, ::std::ranges::iterator_t<V>>
{
return seqan::std::detail::chunk::to_unsigned_like(
return seqan::stl::detail::chunk::to_unsigned_like(
::std::ranges::min(parent_->remainder_, ::std::ranges::end(parent_->base_) - *parent_->current_));
}
};
Expand Down Expand Up @@ -326,7 +326,7 @@ class chunk_view<V> : public ::std::ranges::view_interface<chunk_view<V>>
}

constexpr auto begin()
requires (!seqan::std::detail::simple_view<V>)
requires (!seqan::stl::detail::simple_view<V>)
{
return iterator<false>{this, ::std::ranges::begin(base_)};
}
Expand All @@ -338,7 +338,7 @@ class chunk_view<V> : public ::std::ranges::view_interface<chunk_view<V>>
}

constexpr auto end()
requires (!seqan::std::detail::simple_view<V>)
requires (!seqan::stl::detail::simple_view<V>)
{
if constexpr (::std::ranges::common_range<V> && ::std::ranges::sized_range<V>)
{
Expand Down Expand Up @@ -376,14 +376,14 @@ class chunk_view<V> : public ::std::ranges::view_interface<chunk_view<V>>
constexpr auto size()
requires ::std::ranges::sized_range<V>
{
return seqan::std::detail::chunk::to_unsigned_like(
seqan::std::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
return seqan::stl::detail::chunk::to_unsigned_like(
seqan::stl::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
}
constexpr auto size() const
requires ::std::ranges::sized_range<V const>
{
return seqan::std::detail::chunk::to_unsigned_like(
seqan::std::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
return seqan::stl::detail::chunk::to_unsigned_like(
seqan::stl::detail::chunk::div_ceil(::std::ranges::distance(base_), n_));
}
};

Expand All @@ -393,8 +393,8 @@ template <bool Const>
class chunk_view<V>::iterator
{
private:
using Parent = seqan::std::detail::maybe_const<Const, chunk_view>;
using Base = seqan::std::detail::maybe_const<Const, V>;
using Parent = seqan::stl::detail::maybe_const<Const, chunk_view>;
using Base = seqan::stl::detail::maybe_const<Const, V>;

::std::ranges::iterator_t<Base> current_ = ::std::ranges::iterator_t<Base>{};
::std::ranges::sentinel_t<Base> end_ = ::std::ranges::sentinel_t<Base>{};
Expand Down Expand Up @@ -575,7 +575,7 @@ class chunk_view<V>::iterator
friend constexpr difference_type operator-(::std::default_sentinel_t y, iterator const & x)
requires ::std::sized_sentinel_for<::std::ranges::sentinel_t<Base>, ::std::ranges::iterator_t<Base>>
{
return seqan::std::detail::chunk::div_ceil(x.end_ - x.current_, x.n_);
return seqan::stl::detail::chunk::div_ceil(x.end_ - x.current_, x.n_);
}

friend constexpr difference_type operator-(iterator const & x, ::std::default_sentinel_t y)
Expand All @@ -590,24 +590,24 @@ struct chunk_fn
template <typename Difference>
constexpr auto operator()(Difference n) const
{
return seqan::std::detail::adaptor_from_functor{*this, n};
return seqan::stl::detail::adaptor_from_functor{*this, n};
}

template <seqan::std::ranges::viewable_range Range, typename Difference = ::std::ranges::range_difference_t<Range>>
template <seqan::stl::ranges::viewable_range Range, typename Difference = ::std::ranges::range_difference_t<Range>>
constexpr auto operator()(Range && range, ::std::type_identity_t<Difference> n) const
{
return chunk_view{::std::forward<Range>(range), n};
}
};

} // namespace seqan::std::ranges
} // namespace seqan::stl::ranges

namespace seqan::std::views
namespace seqan::stl::views
{

inline constexpr auto chunk = seqan::std::ranges::chunk_fn{};
inline constexpr auto chunk = seqan::stl::ranges::chunk_fn{};

} // namespace seqan::std::views
} // namespace seqan::stl::views

#endif // ifdef __cpp_lib_ranges_chunk

Expand Down
10 changes: 5 additions & 5 deletions include/hibf/contrib/std/concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/*!\file
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de>
* \brief Provides seqan::std concepts.
* \brief Provides seqan::stl concepts.
*/

// File might be included from multiple libraries.
Expand All @@ -17,15 +17,15 @@
#include <ranges>

#if __cpp_lib_ranges >= 202110L
namespace seqan::std::ranges
namespace seqan::stl::ranges
{

using ::std::ranges::viewable_range;

}
#else
# include "detail/exposition_only.hpp"
namespace seqan::std::ranges
namespace seqan::stl::ranges
{

template <class T>
Expand All @@ -35,9 +35,9 @@ concept viewable_range = ::std::ranges::range<T>
|| (!::std::ranges::view<::std::remove_cvref_t<T>>
&& (::std::is_lvalue_reference_v<T>
|| (::std::movable<::std::remove_reference_t<T>>
&& !seqan::std::detail::is_initializer_list<::std::remove_cvref_t<T>>))));
&& !seqan::stl::detail::is_initializer_list<::std::remove_cvref_t<T>>))));

} // namespace seqan::std::ranges
} // namespace seqan::stl::ranges

#endif

Expand Down
6 changes: 3 additions & 3 deletions include/hibf/contrib/std/detail/adaptor_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// -----------------------------------------------------------------------------------------------------

/*!\file
* \brief Provides seqan::std::detail::adaptor_base and seqan::std::detail::combined_adaptor
* \brief Provides seqan::stl::detail::adaptor_base and seqan::stl::detail::combined_adaptor
* \author Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
*/

Expand All @@ -17,7 +17,7 @@
#include <ranges>
#include <tuple>

namespace seqan::std::detail
namespace seqan::stl::detail
{

// ============================================================================
Expand Down Expand Up @@ -210,6 +210,6 @@ class combined_adaptor :
//!\}
};

} // namespace seqan::std::detail
} // namespace seqan::stl::detail

#endif // SEQAN_STD_DETAIL_ADAPTOR_BASE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// -----------------------------------------------------------------------------------------------------

/*!\file
* \brief Provides seqan::std::detail::adaptor_for_view_without_args
* \brief Provides seqan::stl::detail::adaptor_for_view_without_args
* \author Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
*/

Expand All @@ -16,7 +16,7 @@

#include "adaptor_base.hpp"

namespace seqan::std::detail
namespace seqan::stl::detail
{

// ============================================================================
Expand Down Expand Up @@ -68,6 +68,6 @@ class adaptor_for_view_without_args : public adaptor_base<adaptor_for_view_witho
//!\}
};

} // namespace seqan::std::detail
} // namespace seqan::stl::detail

#endif // SEQAN_STD_DETAIL_ADAPTOR_FOR_VIEW_WITHOUT_ARGS
Loading

0 comments on commit e78c97f

Please sign in to comment.