// (void*) to silence compiler warning for virtual classes (they will
// never arrive here because they are non-trivial).
- if (std::is_trivial<T>::value == true)
+ if (std::is_trivial_v<T> == true)
std::memcpy(static_cast<void *>(destination_ + begin),
static_cast<const void *>(source_ + begin),
(end - begin) * sizeof(T));
// Classes with trivial assignment can use memcpy. cast element to
// (void*) to silence compiler warning for virtual classes (they will
// never arrive here because they are non-trivial).
- if (std::is_trivial<T>::value == true)
+ if (std::is_trivial_v<T> == true)
std::memcpy(static_cast<void *>(destination_ + begin),
static_cast<void *>(source_ + begin),
(end - begin) * sizeof(T));
// do not use memcmp for long double because on some systems it does not
// completely fill its memory and may lead to false positives in
// e.g. valgrind
- if (std::is_trivial<T>::value == true &&
+ if (std::is_trivial_v<T> == true &&
std::is_same_v<T, long double> == false)
{
const unsigned char zero[sizeof(T)] = {};
// element to (void*) to silence compiler warning for virtual
// classes (they will never arrive here because they are
// non-trivial).
- if (std::is_trivial<T>::value == true && trivial_element)
+ if (std::is_trivial_v<T> == true && trivial_element)
std::memset(static_cast<void *>(destination_ + begin),
0,
(end - begin) * sizeof(T));
// element to (void*) to silence compiler warning for virtual
// classes (they will never arrive here because they are
// non-trivial).
- if (std::is_trivial<T>::value == true)
+ if (std::is_trivial_v<T> == true)
std::memset(static_cast<void *>(destination_ + begin),
0,
(end - begin) * sizeof(T));
Assert(owning_aligned_vector->used_elements_end != nullptr,
ExcInternalError());
- if (std::is_trivial<T>::value == false)
+ if (std::is_trivial_v<T> == false)
for (T *p = owning_aligned_vector->used_elements_end - 1; p >= ptr;
--p)
p->~T();
// it, not unique_ptr) so it is still set to its correct value.
if (is_shmem_root)
- if (std::is_trivial<T>::value == false)
+ if (std::is_trivial_v<T> == false)
for (T *p = aligned_vector->used_elements_end - 1; p >= ptr; --p)
p->~T();
// call destructor on fields that are released, if the type requires it.
// doing it backward releases the elements in reverse order as compared to
// how they were created
- if (std::is_trivial<T>::value == false)
+ if (std::is_trivial_v<T> == false)
for (T *p = used_elements_end - 1; p >= elements.get() + new_size; --p)
p->~T();
used_elements_end = elements.get() + new_size;
// need to still set the values in case the class is non-trivial because
// virtual classes etc. need to run their (default) constructor
- if (std::is_trivial<T>::value == false)
+ if (std::is_trivial_v<T> == false)
dealii::internal::AlignedVectorDefaultInitialize<T, true>(
new_size - old_size, elements.get() + old_size);
}
// call destructor on fields that are released, if the type requires it.
// doing it backward releases the elements in reverse order as compared to
// how they were created
- if (std::is_trivial<T>::value == false)
+ if (std::is_trivial_v<T> == false)
for (T *p = used_elements_end - 1; p >= elements.get() + new_size; --p)
p->~T();
used_elements_end = elements.get() + new_size;
// call destructor on fields that are released, if the type requires it.
// doing it backward releases the elements in reverse order as compared to
// how they were created
- if (std::is_trivial<T>::value == false)
+ if (std::is_trivial_v<T> == false)
for (T *p = used_elements_end - 1; p >= elements.get() + new_size; --p)
p->~T();
used_elements_end = elements.get() + new_size;
Assert(used_elements_end <= allocated_elements_end, ExcInternalError());
if (used_elements_end == allocated_elements_end)
reserve(std::max(2 * capacity(), static_cast<size_type>(16)));
- if (std::is_trivial<T>::value == false)
+ if (std::is_trivial_v<T> == false)
new (used_elements_end++) T(in_data);
else
*used_elements_end++ = in_data;
reserve(old_size + (end - begin));
for (; begin != end; ++begin, ++used_elements_end)
{
- if (std::is_trivial<T>::value == false)
+ if (std::is_trivial_v<T> == false)
new (used_elements_end) T;
*used_elements_end = *begin;
}
// has all of the data.
if (is_shmem_root)
{
- if (std::is_trivial<T>::value)
+ if (std::is_trivial_v<T>)
{
// The data is "trivial", i.e., we can copy things directly without
// having to go through the serialization/deserialization machinery of
// shared memory space.
if (is_shmem_root)
{
- if (std::is_trivial<T>::value == true)
+ if (std::is_trivial_v<T> == true)
std::memcpy(aligned_shmem_pointer, elements.get(), sizeof(T) * size());
else
for (std::size_t i = 0; i < size(); ++i)
// nevertheless, leave the static_assert in since it provides a
// more descriptive error message that will simply come after the first
// error produced above
- static_assert(std::is_const<value_type>::value == true,
+ static_assert(std::is_const_v<value_type> == true,
"This constructor may only be called if the ArrayView "
"object has a const value_type. In other words, you can "
"only create an ArrayView to const values from a const "
// nevertheless, leave the static_assert in since it provides a
// more descriptive error message that will simply come after the first
// error produced above
- static_assert(std::is_const<value_type>::value == true,
+ static_assert(std::is_const_v<value_type> == true,
"This constructor may only be called if the ArrayView "
"object has a const value_type. In other words, you can "
"only create an ArrayView to const values from a const "
* the same entry in the same container.
*/
template <typename OtherIterator>
- std::enable_if_t<std::is_convertible<OtherIterator, DerivedIterator>::value,
- bool>
+ std::enable_if_t<std::is_convertible_v<OtherIterator, DerivedIterator>, bool>
operator==(const OtherIterator &right) const
{
const auto &right_2 = static_cast<const DerivedIterator &>(right);
* Opposite of operator==().
*/
template <typename OtherIterator>
- std::enable_if_t<std::is_convertible<OtherIterator, DerivedIterator>::value,
- bool>
+ std::enable_if_t<std::is_convertible_v<OtherIterator, DerivedIterator>, bool>
operator!=(const OtherIterator &right) const
{
return !(*this == right);
* implemented.
*/
template <typename T>
- inline std::enable_if_t<std::is_fundamental<T>::value, std::size_t>
+ inline std::enable_if_t<std::is_fundamental_v<T>, std::size_t>
memory_consumption(const T &t);
/**
* <tt>t.memory_consumption()</tt>'s value.
*/
template <typename T>
- inline std::enable_if_t<!(std::is_fundamental<T>::value ||
- std::is_pointer<T>::value),
+ inline std::enable_if_t<!(std::is_fundamental_v<T> || std::is_pointer_v<T>),
std::size_t>
memory_consumption(const T &t);
namespace MemoryConsumption
{
template <typename T>
- inline std::enable_if_t<std::is_fundamental<T>::value, std::size_t>
+ inline std::enable_if_t<std::is_fundamental_v<T>, std::size_t>
memory_consumption(const T &)
{
return sizeof(T);
memory_consumption(const std::vector<T> &v)
{
// shortcut for types that do not allocate memory themselves
- if (std::is_fundamental<T>::value || std::is_pointer<T>::value)
+ if (std::is_fundamental_v<T> || std::is_pointer_v<T>)
{
return v.capacity() * sizeof(T) + sizeof(v);
}
memory_consumption(const std::array<T, N> &v)
{
// shortcut for types that do not allocate memory themselves
- if (std::is_fundamental<T>::value || std::is_pointer<T>::value)
+ if (std::is_fundamental_v<T> || std::is_pointer_v<T>)
{
return sizeof(v);
}
template <typename T>
- inline std::enable_if_t<!(std::is_fundamental<T>::value ||
- std::is_pointer<T>::value),
+ inline std::enable_if_t<!(std::is_fundamental_v<T> || std::is_pointer_v<T>),
std::size_t>
memory_consumption(const T &t)
{
const MPI_Comm mpi_communicator,
T (&results)[N])
{
- static_assert(std::is_integral<T>::value,
+ static_assert(std::is_integral_v<T>,
"The MPI_LOR operation only allows integral data types.");
internal::all_reduce(MPI_LOR,
T
logical_or(const T &t, const MPI_Comm mpi_communicator)
{
- static_assert(std::is_integral<T>::value,
+ static_assert(std::is_integral_v<T>,
"The MPI_LOR operation only allows integral data types.");
T return_value{};
static_assert(std::is_same_v<std::decay_t<T>, std::decay_t<U>>,
"Input and output arguments must have the same type!");
- static_assert(std::is_integral<typename T::value_type>::value,
+ static_assert(std::is_integral_v<typename T::value_type>,
"The MPI_LOR operation only allows integral data types.");
// Specializations of std containers for the data type bool do not
const MPI_Comm mpi_communicator,
const ArrayView<T> & results)
{
- static_assert(std::is_integral<T>::value,
+ static_assert(std::is_integral_v<T>,
"The MPI_LOR operation only allows integral data types.");
internal::all_reduce(MPI_LOR, values, mpi_communicator, results);
static constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE T
value(const F &f,
std::enable_if_t<!std::is_same_v<std::decay_t<T>, std::decay_t<F>> &&
- std::is_constructible<T, F>::value> * = nullptr)
+ std::is_constructible_v<T, F>> * = nullptr)
{
return T(f);
}
static constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE T
value(const F &f,
std::enable_if_t<!std::is_same_v<std::decay_t<T>, std::decay_t<F>> &&
- !std::is_constructible<T, F>::value &&
+ !std::is_constructible_v<T, F> &&
is_explicitly_convertible<const F, T>::value> * =
nullptr)
{
value(
const F &f,
std::enable_if_t<!std::is_same_v<std::decay_t<T>, std::decay_t<F>> &&
- !std::is_constructible<T, F>::value &&
+ !std::is_constructible_v<T, F> &&
!is_explicitly_convertible<const F, T>::value &&
Differentiation::AD::is_ad_number<F>::value> * = nullptr)
{
const Patterns::PatternBase &pattern,
const bool has_to_be_set)
{
- static_assert(std::is_const<ParameterType>::value == false,
+ static_assert(std::is_const_v<ParameterType> == false,
"You tried to add a parameter using a type "
"that is const. Use a non-const type.");
// standards. To avoid this, we use std::abs on default types but
// simply return the number on unsigned types
template <typename Number>
- std::enable_if_t<!std::is_unsigned<Number>::value,
+ std::enable_if_t<!std::is_unsigned_v<Number>,
typename numbers::NumberTraits<Number>::real_type>
get_abs(const Number a)
{
}
template <typename Number>
- std::enable_if_t<std::is_unsigned<Number>::value, Number>
+ std::enable_if_t<std::is_unsigned_v<Number>, Number>
get_abs(const Number a)
{
return a;
else
# endif
{
- if constexpr (std::is_trivial<Number>::value)
+ if constexpr (std::is_trivial_v<Number>)
{
std::memset(ghost_array.data(),
0,
// Arithmetic types
template <class T>
- struct Convert<T, std::enable_if_t<std::is_arithmetic<T>::value>>
+ struct Convert<T, std::enable_if_t<std::is_arithmetic_v<T>>>
{
template <typename Dummy = T>
static std::enable_if_t<std::is_same_v<Dummy, T> &&
template <typename Dummy = T>
static std::enable_if_t<std::is_same_v<Dummy, T> &&
!std::is_same_v<T, bool> &&
- std::is_integral<T>::value,
+ std::is_integral_v<T>,
std::unique_ptr<Patterns::PatternBase>>
to_pattern()
{
template <typename Dummy = T>
static std::enable_if_t<std::is_same_v<Dummy, T> &&
!std::is_same_v<T, bool> &&
- std::is_floating_point<T>::value,
+ std::is_floating_point_v<T>,
std::unique_ptr<Patterns::PatternBase>>
to_pattern()
{
constexpr TableIndices<N>::TableIndices(const T... args)
: indices{static_cast<std::size_t>(args)...}
{
- static_assert(internal::TemplateConstraints::all_true<
- std::is_integral<T>::value...>::value,
- "Not all of the parameters have integral type!");
+ static_assert(
+ internal::TemplateConstraints::all_true<std::is_integral_v<T>...>::value,
+ "Not all of the parameters have integral type!");
static_assert(sizeof...(T) == N, "Wrong number of constructor arguments!");
}
static_assert(
std::is_copy_constructible<
typename internal::unpack_container<T>::type>::value ||
- std::is_default_constructible<T>::value,
+ std::is_default_constructible_v<T>,
"The stored type must be either copyable, or default constructible");
public:
*/
template <typename T>
std::enable_if_t<
- std::is_copy_constructible<typename unpack_container<T>::type>::value,
+ std::is_copy_constructible_v<typename unpack_container<T>::type>,
T &>
construct_element(std::map<std::thread::id, T> & data,
const std::thread::id & id,
template <typename T>
std::enable_if_t<
- !std::is_copy_constructible<typename unpack_container<T>::type>::value,
+ !std::is_copy_constructible_v<typename unpack_container<T>::type>,
T &>
construct_element(std::map<std::thread::id, T> &data,
const std::thread::id & id,
// return prefactor * dealii::Utilities::pow(base*base, iexp/2);
// </code>
- static_assert(std::is_integral<T>::value, "Only integral types supported");
+ static_assert(std::is_integral_v<T>, "Only integral types supported");
return iexp <= 0 ?
1 :
inline T
fixed_power(const T x)
{
- Assert(((std::is_integral<T>::value == true) && (N >= 0)) ||
- (std::is_integral<T>::value == false),
+ Assert(((std::is_integral_v<T> == true) && (N >= 0)) ||
+ (std::is_integral_v<T> == false),
ExcMessage("If the type of the argument, T, is an integer type, "
"then the exponent N must be a non-negative integer "
"because the result would otherwise not be an integer."));
/**
* A structure that is used to identify whether a template argument is a
* std::vector<T> or std::vector<std::vector<T>> where T is a type that
- * satisfies std::is_trivially_copyable<T>::value == true.
+ * satisfies std::is_trivially_copyable_v<T> == true.
*/
template <typename T>
struct IsVectorOfTriviallyCopyable
struct IsVectorOfTriviallyCopyable<std::vector<T>>
{
static constexpr bool value =
- std::is_trivially_copyable<T>::value && !std::is_same_v<T, bool>;
+ std::is_trivially_copyable_v<T> && !std::is_same_v<T, bool>;
};
struct IsVectorOfTriviallyCopyable<std::vector<std::vector<T>>>
{
static constexpr bool value =
- std::is_trivially_copyable<T>::value && !std::is_same_v<T, bool>;
+ std::is_trivially_copyable_v<T> && !std::is_same_v<T, bool>;
};
/**
* A function that is used to append the contents of a std::vector<T>
- * (where T is a type that satisfies std::is_trivially_copyable<T>::value
+ * (where T is a type that satisfies std::is_trivially_copyable_v<T>
* == true but not T==bool) bit for bit to a character array.
*
* If the type is not such a vector of T, then the function
template <typename T,
typename = std::enable_if_t<!std::is_same_v<T, bool> &&
- std::is_trivially_copyable<T>::value>>
+ std::is_trivially_copyable_v<T>>>
inline void
append_vector_of_trivially_copyable_to_buffer(
const std::vector<T> &object,
template <typename T,
typename = std::enable_if_t<!std::is_same_v<T, bool> &&
- std::is_trivially_copyable<T>::value>>
+ std::is_trivially_copyable_v<T>>>
inline void
append_vector_of_trivially_copyable_to_buffer(
const std::vector<std::vector<T>> &object,
template <typename T,
typename = std::enable_if_t<!std::is_same_v<T, bool> &&
- std::is_trivially_copyable<T>::value>>
+ std::is_trivially_copyable_v<T>>>
inline void
create_vector_of_trivially_copyable_from_buffer(
const std::vector<char>::const_iterator &cbegin,
template <typename T,
typename = std::enable_if_t<!std::is_same_v<T, bool> &&
- std::is_trivially_copyable<T>::value>>
+ std::is_trivially_copyable_v<T>>>
inline void
create_vector_of_trivially_copyable_from_buffer(
const std::vector<char>::const_iterator &cbegin,
// Do the same with surface patches, if possible
SubCellData subcell_data;
- if constexpr (std::is_integral<typename C3T3::Surface_patch_index>::value)
+ if constexpr (std::is_integral_v<typename C3T3::Surface_patch_index>)
{
for (auto face = cgal_triangulation.facets_in_complex_begin();
face != cgal_triangulation.facets_in_complex_end();
}
}
// and curves
- if constexpr (std::is_integral<typename C3T3::Curve_index>::value)
+ if constexpr (std::is_integral_v<typename C3T3::Curve_index>)
{
for (auto edge = cgal_triangulation.edges_in_complex_begin();
edge != cgal_triangulation.edges_in_complex_end();
* potential ambiguities related to implicit conversions in either user
* code or math functions that are loaded into the standard namespace.
*/
- template <
- typename NumberType,
- typename = std::enable_if_t<std::is_arithmetic<NumberType>::value>>
+ template <typename NumberType,
+ typename = std::enable_if_t<std::is_arithmetic_v<NumberType>>>
explicit Expression(const NumberType &value);
/**
* potential ambiguities related to implicit conversions in either user
* code or math functions that are loaded into the standard namespace.
*/
- template <
- typename NumberType,
- typename = std::enable_if_t<std::is_arithmetic<NumberType>::value>>
+ template <typename NumberType,
+ typename = std::enable_if_t<std::is_arithmetic_v<NumberType>>>
explicit Expression(const std::complex<NumberType> &value);
/**
* It is expected that both the @p numerator and @p denominator
* be integral types.
*/
- template <
- typename NumberType,
- typename = std::enable_if_t<std::is_integral<NumberType>::value>>
+ template <typename NumberType,
+ typename = std::enable_if_t<std::is_integral_v<NumberType>>>
Expression(const NumberType &numerator, const NumberType &denominator);
/**
*/
template <typename NumberType,
typename = std::enable_if_t<
- std::is_constructible<Expression, NumberType>::value>>
+ std::is_constructible_v<Expression, NumberType>>>
inline Expression
operator+(const NumberType &lhs, const Expression &rhs)
{
*/
template <typename NumberType,
typename = std::enable_if_t<
- std::is_constructible<Expression, NumberType>::value>>
+ std::is_constructible_v<Expression, NumberType>>>
inline Expression
operator+(const Expression &lhs, const NumberType &rhs)
{
*/
template <typename NumberType,
typename = std::enable_if_t<
- std::is_constructible<Expression, NumberType>::value>>
+ std::is_constructible_v<Expression, NumberType>>>
inline Expression
operator-(const NumberType &lhs, const Expression &rhs)
{
*/
template <typename NumberType,
typename = std::enable_if_t<
- std::is_constructible<Expression, NumberType>::value>>
+ std::is_constructible_v<Expression, NumberType>>>
inline Expression
operator-(const Expression &lhs, const NumberType &rhs)
{
*/
template <typename NumberType,
typename = std::enable_if_t<
- std::is_constructible<Expression, NumberType>::value>>
+ std::is_constructible_v<Expression, NumberType>>>
inline Expression
operator*(const NumberType &lhs, const Expression &rhs)
{
*/
template <typename NumberType,
typename = std::enable_if_t<
- std::is_constructible<Expression, NumberType>::value>>
+ std::is_constructible_v<Expression, NumberType>>>
inline Expression
operator*(const Expression &lhs, const NumberType &rhs)
{
*/
template <typename NumberType,
typename = std::enable_if_t<
- std::is_constructible<Expression, NumberType>::value>>
+ std::is_constructible_v<Expression, NumberType>>>
inline Expression
operator/(const NumberType &lhs, const Expression &rhs)
{
*/
template <typename NumberType,
typename = std::enable_if_t<
- std::is_constructible<Expression, NumberType>::value>>
+ std::is_constructible_v<Expression, NumberType>>>
inline Expression
operator/(const Expression &lhs, const NumberType &rhs)
{
return t;
}
- template <typename T,
- typename = std::enable_if_t<std::is_arithmetic<T>::value>>
+ template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
static Differentiation::SD::Expression
value(const T &t)
{
return Differentiation::SD::Expression(t);
}
- template <typename T,
- typename = std::enable_if_t<std::is_arithmetic<T>::value>>
+ template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
static Differentiation::SD::Expression
value(T &&t)
{
return Differentiation::SD::Expression(t);
}
- template <typename T,
- typename = std::enable_if_t<std::is_arithmetic<T>::value>>
+ template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
static Differentiation::SD::Expression
value(const std::complex<T> &t)
{
template <typename ReturnType_>
struct SupportedOptimizerTypeTraits<
ReturnType_,
- std::enable_if_t<std::is_arithmetic<ReturnType_>::value>>
+ std::enable_if_t<std::is_arithmetic_v<ReturnType_>>>
{
static const bool is_supported = true;
ReturnType_,
std::enable_if_t<
boost::is_complex<ReturnType_>::value &&
- std::is_arithmetic<typename ReturnType_::value_type>::value>>
+ std::is_arithmetic_v<typename ReturnType_::value_type>>>
{
static const bool is_supported = true;
# ifdef HAVE_SYMENGINE_LLVM
template <typename ReturnType_>
- struct LLVMOptimizer<
- ReturnType_,
- std::enable_if_t<std::is_arithmetic<ReturnType_>::value>>
+ struct LLVMOptimizer<ReturnType_,
+ std::enable_if_t<std::is_arithmetic_v<ReturnType_>>>
{
using ReturnType = typename std::
conditional<std::is_same_v<ReturnType_, float>, float, double>::type;
ReturnType_,
std::enable_if_t<
boost::is_complex<ReturnType_>::value &&
- std::is_arithmetic<typename ReturnType_::value_type>::value>>
+ std::is_arithmetic_v<typename ReturnType_::value_type>>>
{
// Since there is no working implementation, these are dummy types
// that help with templating in the calling function.
struct GeneralProductTypeImpl;
template <typename T>
- struct GeneralProductTypeImpl<
- T,
- Differentiation::SD::Expression,
- std::enable_if_t<std::is_arithmetic<T>::value>>
+ struct GeneralProductTypeImpl<T,
+ Differentiation::SD::Expression,
+ std::enable_if_t<std::is_arithmetic_v<T>>>
{
using type = Differentiation::SD::Expression;
};
T,
Differentiation::SD::Expression,
std::enable_if_t<boost::is_complex<T>::value &&
- std::is_arithmetic<typename T::value_type>::value>>
+ std::is_arithmetic_v<typename T::value_type>>>
{
using type = Differentiation::SD::Expression;
};
dealii::internal::is_explicitly_convertible<
SymbolicType,
const SymEngine::RCP<const SymEngine::Basic> &>::value &&
- std::is_constructible<SymbolicType, ValueType>::value>>
+ std::is_constructible_v<SymbolicType, ValueType>>>
void
set_value_in_symbol_map(types::substitution_map &substitution_map,
const SymbolicType & symbol,
dealii::internal::is_explicitly_convertible<
ExpressionType,
const SymEngine::RCP<const SymEngine::Basic> &>::value &&
- std::is_constructible<ExpressionType, ValueType>::value>>
+ std::is_constructible_v<ExpressionType, ValueType>>>
types::substitution_map
make_substitution_map(const ExpressionType &symbol, const ValueType &value);
dealii::internal::is_explicitly_convertible<
ExpressionType,
const SymEngine::RCP<const SymEngine::Basic> &>::value &&
- std::is_constructible<ExpressionType, ValueType>::value>>
+ std::is_constructible_v<ExpressionType, ValueType>>>
void
add_to_substitution_map(types::substitution_map &substitution_map,
const ExpressionType & symbol,
dealii::internal::is_explicitly_convertible<
ExpressionType,
const SymEngine::RCP<const SymEngine::Basic> &>::value &&
- std::is_constructible<ExpressionType, ValueType>::value>>
+ std::is_constructible_v<ExpressionType, ValueType>>>
void
add_to_substitution_map(types::substitution_map & substitution_map,
const std::vector<ExpressionType> &symbols,
* Compare for equality.
*/
template <typename OtherAccessor = Accessor>
- std::enable_if_t<std::is_convertible<OtherAccessor, Accessor>::value, bool>
+ std::enable_if_t<std::is_convertible_v<OtherAccessor, Accessor>, bool>
operator==(const TriaRawIterator<OtherAccessor> &) const;
/**
template <typename Accessor>
template <typename OtherAccessor>
-inline std::enable_if_t<std::is_convertible<OtherAccessor, Accessor>::value,
- bool>
+inline std::enable_if_t<std::is_convertible_v<OtherAccessor, Accessor>, bool>
TriaRawIterator<Accessor>::operator==(
const TriaRawIterator<OtherAccessor> &other) const
{
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename OperatorExemplar,
typename Matrix,
- typename = std::enable_if_t<!std::is_lvalue_reference<Matrix>::value>>
+ typename = std::enable_if_t<!std::is_lvalue_reference_v<Matrix>>>
LinearOperator<Range, Domain, Payload>
linear_operator(const OperatorExemplar &, Matrix &&) = delete;
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename OperatorExemplar,
typename Matrix,
- typename =
- std::enable_if_t<!std::is_lvalue_reference<OperatorExemplar>::value>,
+ typename = std::enable_if_t<!std::is_lvalue_reference_v<OperatorExemplar>>,
typename = std::enable_if_t<
!std::is_same_v<OperatorExemplar, LinearOperator<Range, Domain, Payload>>>>
LinearOperator<Range, Domain, Payload>
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename OperatorExemplar,
typename Matrix,
- typename = std::enable_if_t<!std::is_lvalue_reference<Matrix>::value>,
- typename =
- std::enable_if_t<!std::is_lvalue_reference<OperatorExemplar>::value>,
+ typename = std::enable_if_t<!std::is_lvalue_reference_v<Matrix>>,
+ typename = std::enable_if_t<!std::is_lvalue_reference_v<OperatorExemplar>>,
typename = std::enable_if_t<
!std::is_same_v<OperatorExemplar, LinearOperator<Range, Domain, Payload>>>>
LinearOperator<Range, Domain, Payload>
typename Domain = Range,
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename Matrix,
- typename = std::enable_if_t<!std::is_lvalue_reference<Matrix>::value>>
+ typename = std::enable_if_t<!std::is_lvalue_reference_v<Matrix>>>
LinearOperator<Range, Domain, Payload>
linear_operator(const LinearOperator<Range, Domain, Payload> &,
Matrix &&) = delete;
typename Domain = Range,
typename Payload = internal::LinearOperatorImplementation::EmptyPayload,
typename Matrix,
- typename = std::enable_if_t<!std::is_lvalue_reference<Matrix>::value>>
+ typename = std::enable_if_t<!std::is_lvalue_reference_v<Matrix>>>
LinearOperator<Range, Domain, Payload>
linear_operator(Matrix &&) = delete;
typename Preconditioner,
typename Range = typename Solver::vector_type,
typename Domain = Range,
- typename = std::enable_if_t<!std::is_lvalue_reference<Preconditioner>::value>,
+ typename = std::enable_if_t<!std::is_lvalue_reference_v<Preconditioner>>,
typename =
std::enable_if_t<!std::is_same_v<Preconditioner, PreconditionIdentity>>,
typename = std::enable_if_t<
using size_type = types::global_dof_index;
template <typename T>
- std::enable_if_t<std::is_trivial<T>::value>
+ std::enable_if_t<std::is_trivial_v<T>>
zero_subrange(const size_type begin, const size_type end, T *dst)
{
std::memset(dst + begin, 0, (end - begin) * sizeof(T));
}
template <typename T>
- std::enable_if_t<!std::is_trivial<T>::value>
+ std::enable_if_t<!std::is_trivial_v<T>>
zero_subrange(const size_type begin, const size_type end, T *dst)
{
std::fill(dst + begin, dst + end, 0);
grain_size);
else if (matrix_size > 0)
{
- if constexpr (std::is_trivial<number>::value)
+ if constexpr (std::is_trivial_v<number>)
std::memset(val.get(), 0, matrix_size * sizeof(number));
else
std::fill(val.get(), val.get() + matrix_size, 0);
if (value == Number())
{
- if constexpr (std::is_trivial<Number>::value)
+ if constexpr (std::is_trivial_v<Number>)
{
std::memset(dst + begin, 0, sizeof(Number) * (end - begin));
return;
{
using BaseVectorType = typename ConstBlockVectorSelector<
VectorType,
- std::is_const<VectorType>::value>::BaseVectorType;
+ std::is_const_v<VectorType>>::BaseVectorType;
static BaseVectorType *
get_vector_component(VectorType &vec, const unsigned int component)
& parent,
const value_type parent_value)
{
- static_assert(std::is_arithmetic<value_type>::value &&
+ static_assert(std::is_arithmetic_v<value_type> &&
!std::is_same_v<value_type, bool>,
"The provided value_type may not meet the requirements "
"of this function.");
& parent,
const value_type parent_value)
{
- static_assert(std::is_arithmetic<value_type>::value &&
+ static_assert(std::is_arithmetic_v<value_type> &&
!std::is_same_v<value_type, bool>,
"The provided value_type may not meet the requirements "
"of this function.");
sum(const typename dealii::Triangulation<dim, spacedim>::cell_iterator &,
const std::vector<value_type> &children_values)
{
- static_assert(std::is_arithmetic<value_type>::value &&
+ static_assert(std::is_arithmetic_v<value_type> &&
!std::is_same_v<value_type, bool>,
"The provided value_type may not meet the requirements "
"of this function.");
const typename dealii::Triangulation<dim, spacedim>::cell_iterator &,
const std::vector<value_type> &children_values)
{
- static_assert(std::is_arithmetic<value_type>::value &&
+ static_assert(std::is_arithmetic_v<value_type> &&
!std::is_same_v<value_type, bool>,
"The provided value_type may not meet the requirements "
"of this function.");
{
public:
static_assert(
- std::is_default_constructible<T>::value,
+ std::is_default_constructible_v<T>,
"This class requires that the elements of type T are default constructible.");
/**
* VectorAdaptor::value_type itself is a type for real-valued numbers.
* Therefore, VectorAdaptor supports vectors whose real_type is
* convertible to value_type in the sense that
- * <code>std::is_convertible<real_type, value_type>::value</code> yields
+ * <code>std::is_convertible_v<real_type, value_type></code> yields
* <code>true</code>.
*
* The <tt>VectorType</tt> should contain the following methods.
*/
using real_type = typename VectorType::real_type;
- static_assert(std::is_convertible<real_type, value_type>::value,
+ static_assert(std::is_convertible_v<real_type, value_type>,
"The real_type of the current VectorType is not "
"convertible to the value_type.");
*/
template <typename VectorType>
std::enable_if_t<
- std::is_convertible<VectorType *, Function<spacedim> *>::value == false>
+ std::is_convertible_v<VectorType *, Function<spacedim> *> == false>
set_particle_positions(const VectorType &input_vector,
const bool displace_particles = true);
template <int dim, int spacedim>
template <typename VectorType>
inline std::enable_if_t<
- std::is_convertible<VectorType *, Function<spacedim> *>::value == false>
+ std::is_convertible_v<VectorType *, Function<spacedim> *> == false>
ParticleHandler<dim, spacedim>::set_particle_positions(
const VectorType &input_vector,
const bool displace_particles)
// https://en.cppreference.com/w/cpp/string/basic_string/to_string). So
// resort to boost::lexical_cast for all other types (in
// particular for floating point types.
- std::string lc_string = (std::is_integral<number>::value ?
- std::to_string(value) :
- boost::lexical_cast<std::string>(value));
+ std::string lc_string =
+ (std::is_integral_v<number> ? std::to_string(value) :
+ boost::lexical_cast<std::string>(value));
if ((digits != numbers::invalid_unsigned_int) &&
(lc_string.size() < digits))
// and it is trivial (can be statically default initialized)
// Here, the trait std::is_pod cannot be used because it is deprecated
// in C++20.
-static_assert(std::is_standard_layout<VectorizedArray<double>>::value &&
- std::is_trivial<VectorizedArray<double>>::value,
+static_assert(std::is_standard_layout_v<VectorizedArray<double>> &&
+ std::is_trivial_v<VectorizedArray<double>>,
"VectorizedArray<double> must be a POD type");
-static_assert(std::is_standard_layout<VectorizedArray<float>>::value &&
- std::is_trivial<VectorizedArray<float>>::value,
+static_assert(std::is_standard_layout_v<VectorizedArray<float>> &&
+ std::is_trivial_v<VectorizedArray<float>>,
"VectorizedArray<float> must be a POD type");
DEAL_II_NAMESPACE_CLOSE
* std::abs on default types, but simply return the number on unsigned types.
*/
template <typename Number>
- std::enable_if_t<!std::is_unsigned<Number>::value,
+ std::enable_if_t<!std::is_unsigned_v<Number>,
typename numbers::NumberTraits<Number>::real_type>
get_abs(const Number a)
{
}
template <typename Number>
- std::enable_if_t<std::is_unsigned<Number>::value, Number>
+ std::enable_if_t<std::is_unsigned_v<Number>, Number>
get_abs(const Number a)
{
return a;
constexpr bool
is_const_reference()
{
- return std::is_reference<T>::value &&
- std::is_const<typename std::remove_reference<T>::type>::value;
+ return std::is_reference_v<T> &&
+ std::is_const_v<typename std::remove_reference<T>::type>;
}
void
AssertThrow(a.begin() == &v[4], ExcInternalError());
AssertThrow(a.end() == &v[7], ExcInternalError());
- static_assert(std::is_reference<decltype(*a.begin())>::value,
+ static_assert(std::is_reference_v<decltype(*a.begin())>,
"type should be a reference");
- static_assert(std::is_reference<decltype(*a.end())>::value,
+ static_assert(std::is_reference_v<decltype(*a.end())>,
"type should be a reference");
static_assert(!is_const_reference<decltype(*a.begin())>(),
"type should not be const");
constexpr bool
is_const_reference()
{
- return std::is_reference<T>::value &&
- std::is_const<typename std::remove_reference<T>::type>::value;
+ return std::is_reference_v<T> &&
+ std::is_const_v<typename std::remove_reference<T>::type>;
}
void
std::fill(v.begin(), v.end(), 42.0);
auto a = make_array_view(v.cbegin() + 2, v.cend());
// a needs to be ArrayView<const double>
- static_assert(!std::is_const<decltype(a)>::value,
+ static_assert(!std::is_const_v<decltype(a)>,
"a should not be const (but has const value)");
- static_assert(std::is_const<decltype(a)::value_type>::value,
+ static_assert(std::is_const_v<decltype(a)::value_type>,
"a::value_type needs to be const");
static_assert(is_const_reference<decltype(*a.begin())>(),
"type needs to be const");
// the type checking in that case
#if BOOST_VERSION >= 106200
// a needs to be const ArrayView<const double>
- static_assert(std::is_const<decltype(a)>::value,
+ static_assert(std::is_const_v<decltype(a)>,
"a should not be const (but has const value)");
- static_assert(std::is_const<decltype(a)::value_type>::value,
+ static_assert(std::is_const_v<decltype(a)::value_type>,
"a::value_type needs to be const");
static_assert(is_const_reference<decltype(*a.begin())>(),
"type needs to be const");
class TensorType,
typename NumberType1,
typename NumberType2>
-std::enable_if_t<!std::is_constructible<NumberType1, NumberType2>::value, void>
+std::enable_if_t<!std::is_constructible_v<NumberType1, NumberType2>, void>
test_tensor_constructor(const std::string &, const std::string &)
{}
class TensorType,
typename NumberType1,
typename NumberType2>
-std::enable_if_t<std::is_constructible<NumberType1, NumberType2>::value, void>
+std::enable_if_t<std::is_constructible_v<NumberType1, NumberType2>, void>
test_tensor_constructor(const std::string &type1, const std::string &type2)
{
deallog << "Rank " << rank << ", "