Loading...
Searching...
No Matches
basic.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <tuple>
#include <type_traits>
#include <seqan3/core/platform.hpp>
// ----------------------------------------------------------------------------
// is_constexpr
// ----------------------------------------------------------------------------
#if defined(__clang__) // https://github.com/llvm/llvm-project/issues/58078
# define SEQAN3_IS_CONSTEXPR(...) true
#else
# define SEQAN3_IS_CONSTEXPR(...) std::integral_constant<bool, __builtin_constant_p(((void)__VA_ARGS__, 0))>::value
#endif
namespace seqan3
{
// ----------------------------------------------------------------------------
// remove_rvalue_reference
// ----------------------------------------------------------------------------
template <typename t>
struct remove_rvalue_reference
{
using type = std::conditional_t<std::is_rvalue_reference_v<t>, std::remove_reference_t<t>, t>;
};
template <typename t>
using remove_rvalue_reference_t = typename remove_rvalue_reference<t>::type;
// ----------------------------------------------------------------------------
// is_constexpr_default_constructible
// ----------------------------------------------------------------------------
template <typename t>
struct is_constexpr_default_constructible : std::false_type
{};
template <typename t>
requires std::is_default_constructible_v<t>
struct is_constexpr_default_constructible<t> : std::integral_constant<bool, SEQAN3_IS_CONSTEXPR(t{})>
{};
template <typename t>
inline constexpr bool is_constexpr_default_constructible_v = is_constexpr_default_constructible<t>::value;
} // namespace seqan3
namespace seqan3::detail
{
// ----------------------------------------------------------------------------
// deferred_type
// ----------------------------------------------------------------------------
template <typename t, typename... dependent_ts>
struct deferred_type
{
using type = t;
};
template <typename t, typename... dependent_ts>
using deferred_type_t = typename deferred_type<t, dependent_ts...>::type;
// ----------------------------------------------------------------------------
// ignore_t
// ----------------------------------------------------------------------------
using ignore_t = std::remove_cvref_t<decltype(std::ignore)>;
template <typename t>
constexpr bool decays_to_ignore_v = std::is_same_v<std::remove_cvref_t<t>, ignore_t>;
} // namespace seqan3::detail
// ----------------------------------------------------------------------------
// SEQAN3_IS_SAME
// ----------------------------------------------------------------------------
#if defined(__clang__)
# define SEQAN3_IS_SAME(...) __is_same(__VA_ARGS__)
#elif defined(__GNUC__)
# define SEQAN3_IS_SAME(...) __is_same_as(__VA_ARGS__)
#else
# define SEQAN3_IS_SAME(...) std::is_same_v<__VA_ARGS__>
#endif
std::conditional_t
std::false_type
std::is_default_constructible_v
T is_default_constructible_v
std::is_same_v
T is_same_v
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
platform.hpp
Provides platform and dependency checks.
std::remove_reference_t
seqan3::is_constexpr_default_constructible
Whether a type std::is_default_constructible in constexpr-context (unary_type_trait specialisation).
Definition basic.hpp:72
seqan3::is_constexpr_default_constructible::is_constexpr_default_constructible_v
constexpr bool is_constexpr_default_constructible_v
Whether a type std::is_default_constructible in constexpr-context (unary_type_trait shortcut).
Definition basic.hpp:86
seqan3::remove_rvalue_reference
Return the input type with && removed, but lvalue references preserved.
Definition basic.hpp:48
seqan3::remove_rvalue_reference::remove_rvalue_reference_t
typename remove_rvalue_reference< t >::type remove_rvalue_reference_t
Return the input type with && removed, but lvalue references preserved (transformation_trait shortcut...
Definition basic.hpp:59
seqan3::remove_rvalue_reference::type
std::conditional_t< std::is_rvalue_reference_v< t >, std::remove_reference_t< t >, t > type
The return type is the input type with any && stripped.
Definition basic.hpp:50
tuple
type_traits
Hide me