Skip to content

Commit

Permalink
Merge pull request #2079 from wvandertoorn/remove_cvref_t-to-std-name…
Browse files Browse the repository at this point in the history
…space

[FIX] Move remove_cvref_t into std namespace
  • Loading branch information
eseiler authored Sep 16, 2020
2 parents 3be0a8a + 6441c2a commit 3bee0fd
Show file tree
Hide file tree
Showing 78 changed files with 236 additions and 194 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ namespace seqan3
template <typename char_t, typename alignment_t>
//!\cond
requires (detail::debug_streamable_tuple<alignment_t> &&
detail::all_model_aligned_seq<detail::tuple_type_list_t<remove_cvref_t<alignment_t>>>)
detail::all_model_aligned_seq<detail::tuple_type_list_t<std::remove_cvref_t<alignment_t>>>)
//!\endcond
inline debug_stream_type<char_t> & operator<<(debug_stream_type<char_t> & stream, alignment_t && alignment)
{
constexpr size_t sequence_count = std::tuple_size_v<remove_cvref_t<alignment_t>>;
constexpr size_t sequence_count = std::tuple_size_v<std::remove_cvref_t<alignment_t>>;

static_assert(sequence_count >= 2, "An alignment requires at least two sequences.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class end_gaps
{
detail::for_each([this](auto e)
{
values[remove_cvref_t<decltype(e)>::id()] = e();
values[std::remove_cvref_t<decltype(e)>::id()] = e();
}, args...);
}
//\!}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct scoring_scheme : public pipeable_config_element<scoring_scheme<scoring_sc

//!\brief Deduces the scoring scheme type from the constructor argument.
template <typename scheme_t>
scoring_scheme(scheme_t) -> scoring_scheme<remove_cvref_t<scheme_t>>;
scoring_scheme(scheme_t) -> scoring_scheme<std::remove_cvref_t<scheme_t>>;
//!\}

} // namespace seqan3::align_cfg
4 changes: 2 additions & 2 deletions include/seqan3/alignment/matrix/alignment_coordinate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ class alignment_coordinate
*/
template <typename char_t, typename coordinate_type>
//!\cond
requires std::same_as<remove_cvref_t<coordinate_type>, alignment_coordinate> ||
detail::is_value_specialisation_of_v<remove_cvref_t<coordinate_type>,
requires std::same_as<std::remove_cvref_t<coordinate_type>, alignment_coordinate> ||
detail::is_value_specialisation_of_v<std::remove_cvref_t<coordinate_type>,
detail::advanceable_alignment_coordinate>
//!\endcond
inline debug_stream_type<char_t> & operator<<(debug_stream_type<char_t> & s, coordinate_type && c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace seqan3::detail
*/
template <typename trace_matrix_t>
//!\cond
requires matrix<remove_cvref_t<trace_matrix_t>> &&
std::same_as<typename remove_cvref_t<trace_matrix_t>::value_type, trace_directions>
requires matrix<std::remove_cvref_t<trace_matrix_t>> &&
std::same_as<typename std::remove_cvref_t<trace_matrix_t>::value_type, trace_directions>
//!\endcond
inline alignment_coordinate alignment_begin_positions(trace_matrix_t && matrix,
alignment_coordinate const end_positions)
Expand Down Expand Up @@ -99,8 +99,8 @@ template <
typename query_t,
typename trace_matrix_t>
//!\cond
requires matrix<remove_cvref_t<trace_matrix_t>> &&
std::same_as<typename remove_cvref_t<trace_matrix_t>::value_type, trace_directions> &&
requires matrix<std::remove_cvref_t<trace_matrix_t>> &&
std::same_as<typename std::remove_cvref_t<trace_matrix_t>::value_type, trace_directions> &&
detail::all_model_writable_aligned_seq<detail::tuple_type_list_t<alignment_t>>
//!\endcond
inline alignment_t alignment_trace(database_t && database,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ class score_matrix_single_column<score_t>::matrix_iterator

//!\brief The transform adaptor to convert the tuple from the zip view into a seqan3::detail::affine_cell_type.
static constexpr auto transform_to_affine_cell = std::views::transform([] (auto && tpl)
-> affine_cell_proxy<remove_cvref_t<decltype(tpl)>>
-> affine_cell_proxy<std::remove_cvref_t<decltype(tpl)>>
{
using fwd_tuple_t = decltype(tpl);
return affine_cell_proxy<remove_cvref_t<fwd_tuple_t>>{std::forward<fwd_tuple_t>(tpl)};
return affine_cell_proxy<std::remove_cvref_t<fwd_tuple_t>>{std::forward<fwd_tuple_t>(tpl)};
});

//!\brief The pointer to the underlying matrix.
Expand Down
14 changes: 7 additions & 7 deletions include/seqan3/alignment/matrix/matrix_concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,43 +38,43 @@ constexpr score_type matrix_inf = std::numeric_limits<score_type>::max();
*/
//!\cond
template <typename matrix_t>
SEQAN3_CONCEPT matrix = requires(remove_cvref_t<matrix_t> m)
SEQAN3_CONCEPT matrix = requires(std::remove_cvref_t<matrix_t> m)
{
//!\endcond

/*!\typedef typedef IMPLEMENTATION_DEFINED value_type;
* \brief The type of an entry in the matrix.
*/
typename remove_cvref_t<matrix_t>::value_type;
typename std::remove_cvref_t<matrix_t>::value_type;
/*!\typedef typedef IMPLEMENTATION_DEFINED reference;
* \brief The type of a reference to an entry in the matrix.
*/
typename remove_cvref_t<matrix_t>::reference;
typename std::remove_cvref_t<matrix_t>::reference;
/*!\typedef typedef IMPLEMENTATION_DEFINED size_type;
* \brief The size type of the matrix.
*/
typename remove_cvref_t<matrix_t>::size_type;
typename std::remove_cvref_t<matrix_t>::size_type;

/*!\fn size_type cols() const noexcept;
* \brief The number of columns in the matrix.
*/
//!\cond
SEQAN3_RETURN_TYPE_CONSTRAINT(m.cols(), std::same_as, typename remove_cvref_t<matrix_t>::size_type);
SEQAN3_RETURN_TYPE_CONSTRAINT(m.cols(), std::same_as, typename std::remove_cvref_t<matrix_t>::size_type);
//!\endcond

/*!\fn size_type rows() const noexcept;
* \brief The number of rows in the matrix.
*/
//!\cond
SEQAN3_RETURN_TYPE_CONSTRAINT(m.rows(), std::same_as, typename remove_cvref_t<matrix_t>::size_type);
SEQAN3_RETURN_TYPE_CONSTRAINT(m.rows(), std::same_as, typename std::remove_cvref_t<matrix_t>::size_type);
//!\endcond

/*!\fn reference at(matrix_coordinate coordinate) noexcept;
* \brief A reference to the entry of the matrix at the given coordinate.
*/
//!\cond
SEQAN3_RETURN_TYPE_CONSTRAINT(m.at(matrix_coordinate{}),
std::same_as, typename remove_cvref_t<matrix_t>::reference);
std::same_as, typename std::remove_cvref_t<matrix_t>::reference);
//!\endcond

//!\cond
Expand Down
2 changes: 1 addition & 1 deletion include/seqan3/alignment/pairwise/align_pairwise.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ constexpr auto align_pairwise(sequence_t && sequences,
// Configure the alignment algorithm.
auto && [algorithm, complete_config] = detail::alignment_configurator::configure<decltype(seq_view)>(config);

using complete_config_t = remove_cvref_t<decltype(complete_config)>;
using complete_config_t = std::remove_cvref_t<decltype(complete_config)>;
using traits_t = detail::alignment_configuration_traits<complete_config_t>;

auto indexed_sequence_chunk_view = views::zip(seq_view, std::views::iota(0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ template <std::ranges::forward_range first_range_t,
std::ranges::forward_range second_range_t,
typename configuration_t>
//!\cond
requires is_type_specialisation_of_v<remove_cvref_t<configuration_t>, configuration>
requires is_type_specialisation_of_v<std::remove_cvref_t<configuration_t>, configuration>
//!\endcond
struct align_result_selector
{
Expand Down
8 changes: 4 additions & 4 deletions include/seqan3/alignment/pairwise/alignment_configurator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ struct alignment_configurator
{
// TODO: Instead of relying on nucleotide scoring schemes we need to be able to determine the edit distance
// option via the scheme.
if constexpr (is_type_specialisation_of_v<remove_cvref_t<decltype(scoring_scheme)>,
if constexpr (is_type_specialisation_of_v<std::remove_cvref_t<decltype(scoring_scheme)>,
nucleotide_scoring_scheme>)
{
if ((scoring_scheme.score('A'_dna15, 'A'_dna15) == 0) &&
Expand Down Expand Up @@ -378,16 +378,16 @@ struct alignment_configurator

// Get the value for the sequence ends configuration.
auto align_ends_cfg = cfg.get_or(align_cfg::aligned_ends{free_ends_none}).value;
using align_ends_cfg_t = remove_cvref_t<decltype(align_ends_cfg)>;
using align_ends_cfg_t = std::remove_cvref_t<decltype(align_ends_cfg)>;

auto configure_edit_traits = [&] (auto is_semi_global)
{
struct edit_traits_type
{
using is_semi_global_type [[maybe_unused]] = remove_cvref_t<decltype(is_semi_global)>;
using is_semi_global_type [[maybe_unused]] = std::remove_cvref_t<decltype(is_semi_global)>;
};

edit_distance_algorithm<remove_cvref_t<config_t>, edit_traits_type> algorithm{cfg};
edit_distance_algorithm<std::remove_cvref_t<config_t>, edit_traits_type> algorithm{cfg};
return function_wrapper_t{std::move(algorithm)};
};

Expand Down
4 changes: 2 additions & 2 deletions include/seqan3/alignment/pairwise/alignment_result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@ namespace seqan3
*/
template <typename char_t, typename alignment_result_t>
//!\cond
requires detail::is_type_specialisation_of_v<remove_cvref_t<alignment_result_t>, alignment_result>
requires detail::is_type_specialisation_of_v<std::remove_cvref_t<alignment_result_t>, alignment_result>
//!\endcond
inline debug_stream_type<char_t> & operator<<(debug_stream_type<char_t> & stream, alignment_result_t && result)
{
using disabled_t = std::nullopt_t *;
using result_data_t =
typename detail::alignment_result_value_type_accessor<remove_cvref_t<alignment_result_t>>::type;
typename detail::alignment_result_value_type_accessor<std::remove_cvref_t<alignment_result_t>>::type;

constexpr bool has_sequence1_id = !std::is_same_v<decltype(std::declval<result_data_t>().sequence1_id), disabled_t>;
constexpr bool has_sequence2_id = !std::is_same_v<decltype(std::declval<result_data_t>().sequence2_id), disabled_t>;
Expand Down
2 changes: 1 addition & 1 deletion include/seqan3/alignment/pairwise/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct alignment_configuration_traits
public:
//!\brief Flag to indicate vectorised mode.
static constexpr bool is_vectorised =
configuration_t::template exists<remove_cvref_t<decltype(align_cfg::vectorised)>>();
configuration_t::template exists<std::remove_cvref_t<decltype(align_cfg::vectorised)>>();
//!\brief Flag indicating whether parallel alignment mode is enabled.
static constexpr bool is_parallel = configuration_t::template exists<align_cfg::parallel>();
//!\brief Flag indicating whether global alignment method is enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class edit_distance_algorithm
}

//!\brief The alignment configuration stored on the heap.
std::shared_ptr<remove_cvref_t<config_t>> cfg_ptr{};
std::shared_ptr<std::remove_cvref_t<config_t>> cfg_ptr{};
};

} // namespace seqan3::detail
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class edit_distance_unbanded_trace_matrix_policy :
//! Only available if default_edit_distance_trait_type::compute_sequence_alignment is true.
auto alignment() const noexcept
{
using alignment_t = remove_cvref_t<decltype(std::declval<alignment_result_type &>().alignment())>;
using alignment_t = std::remove_cvref_t<decltype(std::declval<alignment_result_type &>().alignment())>;

derived_t const * self = static_cast<derived_t const *>(this);
static_assert(edit_traits::compute_sequence_alignment, "alignment() can only be computed if you specify the "
Expand Down
2 changes: 1 addition & 1 deletion include/seqan3/alphabet/aminoacid/concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ namespace seqan3
* follow the above instructions.
*/
template <typename t>
inline constexpr bool enable_aminoacid = detail::adl_only::enable_aminoacid_dispatcher::dispatch<remove_cvref_t<t>>();
inline constexpr bool enable_aminoacid = detail::adl_only::enable_aminoacid_dispatcher::dispatch<std::remove_cvref_t<t>>();

// ============================================================================
// concept
Expand Down
4 changes: 2 additions & 2 deletions include/seqan3/alphabet/composite/alphabet_variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ class alphabet_variant : public alphabet_base<alphabet_variant<alternative_types

meta::for_each(alternatives{}, [&] (auto && alt)
{
if (char_is_valid_for<remove_cvref_t<decltype(alt)>>(chr))
if (char_is_valid_for<std::remove_cvref_t<decltype(alt)>>(chr))
is_valid = true;
});

Expand Down Expand Up @@ -572,7 +572,7 @@ class alphabet_variant : public alphabet_base<alphabet_variant<alternative_types

meta::for_each(alternatives{}, [&] (auto && alt)
{
using alt_type = remove_cvref_t<decltype(alt)>;
using alt_type = std::remove_cvref_t<decltype(alt)>;

if (there_was_no_valid_representation && char_is_valid_for<alt_type>(chr))
{
Expand Down
16 changes: 8 additions & 8 deletions include/seqan3/alphabet/concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,13 @@ struct char_is_valid_for_fn
{
public:
//!\brief `alph_t` with cvref removed and possibly wrapped in std::type_identity.
using s_alph_t = std::conditional_t<std::is_nothrow_default_constructible_v<remove_cvref_t<alph_t>>,
remove_cvref_t<alph_t>,
using s_alph_t = std::conditional_t<std::is_nothrow_default_constructible_v<std::remove_cvref_t<alph_t>>,
std::remove_cvref_t<alph_t>,
std::type_identity<alph_t>>;

SEQAN3_CPO_IMPL(3, (deferred_type_t<seqan3::custom::alphabet<alph_t>, decltype(v)>::char_is_valid(v))) // expl. cst.
SEQAN3_CPO_IMPL(2, (char_is_valid_for(v, s_alph_t{}) )) // ADL
SEQAN3_CPO_IMPL(1, (deferred_type_t<remove_cvref_t<alph_t>, decltype(v)>::char_is_valid(v) )) // member
SEQAN3_CPO_IMPL(1, (deferred_type_t<std::remove_cvref_t<alph_t>, decltype(v)>::char_is_valid(v) )) // member
SEQAN3_CPO_IMPL(0, (seqan3::to_char(seqan3::assign_char_to(v, s_alph_t{})) == v )) // fallback

public:
Expand Down Expand Up @@ -619,14 +619,14 @@ struct alphabet_size_fn
{
public:
//!\brief `alph_t` with cvref removed and possibly wrapped in std::type_identity.
using s_alph_t = std::conditional_t<std::is_nothrow_default_constructible_v<remove_cvref_t<alph_t>> &&
seqan3::is_constexpr_default_constructible_v<remove_cvref_t<alph_t>>,
remove_cvref_t<alph_t>,
using s_alph_t = std::conditional_t<std::is_nothrow_default_constructible_v<std::remove_cvref_t<alph_t>> &&
seqan3::is_constexpr_default_constructible_v<std::remove_cvref_t<alph_t>>,
std::remove_cvref_t<alph_t>,
std::type_identity<alph_t>>;

SEQAN3_CPO_IMPL(2, (deferred_type_t<seqan3::custom::alphabet<alph_t>, decltype(v)>::alphabet_size)) // expl. cst.
SEQAN3_CPO_IMPL(1, (alphabet_size(v) )) // ADL
SEQAN3_CPO_IMPL(0, (deferred_type_t<remove_cvref_t<alph_t>, decltype(v)>::alphabet_size )) // member
SEQAN3_CPO_IMPL(0, (deferred_type_t<std::remove_cvref_t<alph_t>, decltype(v)>::alphabet_size )) // member

public:
//!\brief Operator definition.
Expand All @@ -636,7 +636,7 @@ struct alphabet_size_fn
{
{ impl(priority_tag<2>{}, s_alph_t{}, dummy{}) };
requires noexcept(impl(priority_tag<2>{}, s_alph_t{}, dummy{}));
requires std::integral<remove_cvref_t<decltype(impl(priority_tag<2>{}, s_alph_t{}, dummy{}))>>;
requires std::integral<std::remove_cvref_t<decltype(impl(priority_tag<2>{}, s_alph_t{}, dummy{}))>>;
}
//!\endcond
constexpr auto operator()() const noexcept
Expand Down
8 changes: 4 additions & 4 deletions include/seqan3/alphabet/structure/concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,16 @@ void max_pseudoknot_depth(args_t ...) = delete;
* \ingroup structure
*/
template <typename alph_t,
typename s_alph_t = std::conditional_t<std::is_nothrow_default_constructible_v<remove_cvref_t<alph_t>> &&
seqan3::is_constexpr_default_constructible_v<remove_cvref_t<alph_t>>,
remove_cvref_t<alph_t>,
typename s_alph_t = std::conditional_t<std::is_nothrow_default_constructible_v<std::remove_cvref_t<alph_t>> &&
seqan3::is_constexpr_default_constructible_v<std::remove_cvref_t<alph_t>>,
std::remove_cvref_t<alph_t>,
std::type_identity<alph_t>>>
struct max_pseudoknot_depth_fn
{
public:
SEQAN3_CPO_IMPL(2, (deferred_type_t<seqan3::custom::alphabet<alph_t>, decltype(v)>::max_pseudoknot_depth)) // custom
SEQAN3_CPO_IMPL(1, (max_pseudoknot_depth(v) )) // ADL
SEQAN3_CPO_IMPL(0, (deferred_type_t<remove_cvref_t<alph_t>, decltype(v)>::max_pseudoknot_depth )) // member
SEQAN3_CPO_IMPL(0, (deferred_type_t<std::remove_cvref_t<alph_t>, decltype(v)>::max_pseudoknot_depth )) // member

public:
//!\brief Operator definition.
Expand Down
10 changes: 5 additions & 5 deletions include/seqan3/argument_parser/auxiliary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ template <typename option_t>
struct enumeration_names_fn
{
//!\brief `option_t` with cvref removed and possibly wrapped in std::type_identity.
using s_option_t = std::conditional_t<std::is_nothrow_default_constructible_v<remove_cvref_t<option_t>> &&
seqan3::is_constexpr_default_constructible_v<remove_cvref_t<option_t>>,
remove_cvref_t<option_t>,
using s_option_t = std::conditional_t<std::is_nothrow_default_constructible_v<std::remove_cvref_t<option_t>> &&
seqan3::is_constexpr_default_constructible_v<std::remove_cvref_t<option_t>>,
std::remove_cvref_t<option_t>,
std::type_identity<option_t>>;

SEQAN3_CPO_IMPL(1, (deferred_type_t<seqan3::custom::argument_parsing<option_t>, decltype(v)>::enumeration_names))
Expand All @@ -98,7 +98,7 @@ struct enumeration_names_fn
{
{ impl(priority_tag<1>{}, s_option_t{}, dummy{}) };
std::same_as<decltype(impl(priority_tag<1>{}, s_option_t{}, dummy{})),
std::unordered_map<std::string_view, remove_cvref_t<option_t>>>;
std::unordered_map<std::string_view, std::remove_cvref_t<option_t>>>;
}
//!\endcond
auto operator()() const
Expand Down Expand Up @@ -205,7 +205,7 @@ SEQAN3_CONCEPT argument_parser_compatible_option = input_stream_over<std::istrin
*/
template <typename char_t, typename option_type>
//!\cond
requires named_enumeration<remove_cvref_t<option_type>>
requires named_enumeration<std::remove_cvref_t<option_type>>
//!\endcond
inline debug_stream_type<char_t> & operator<<(debug_stream_type<char_t> & s, option_type && op)
{
Expand Down
2 changes: 1 addition & 1 deletion include/seqan3/argument_parser/detail/format_parse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class format_parse : public format_base
template <typename id_type>
static bool is_empty_id(id_type const & id)
{
if constexpr (std::same_as<remove_cvref_t<id_type>, std::string>)
if constexpr (std::same_as<std::remove_cvref_t<id_type>, std::string>)
return id.empty();
else // char
return is_char<'\0'>(id);
Expand Down
2 changes: 1 addition & 1 deletion include/seqan3/argument_parser/validators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace seqan3
//!\}
//!\cond
template <typename validator_type>
SEQAN3_CONCEPT validator = std::copyable<remove_cvref_t<validator_type>> &&
SEQAN3_CONCEPT validator = std::copyable<std::remove_cvref_t<validator_type>> &&
requires(validator_type validator,
typename std::remove_reference_t<validator_type>::option_value_type value)
{
Expand Down
Loading

0 comments on commit 3bee0fd

Please sign in to comment.