Skip to content

Commit

Permalink
modernize usage of type traits (ECP-WarpX#5184)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafedeli88 authored Aug 28, 2024
1 parent 741d231 commit aaf3cf0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Source/Initialization/PlasmaInjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name,
{

#ifdef AMREX_USE_GPU
static_assert(std::is_trivially_copyable<InjectorPosition>::value,
static_assert(std::is_trivially_copyable_v<InjectorPosition>,
"InjectorPosition must be trivially copyable");
static_assert(std::is_trivially_copyable<InjectorDensity>::value,
static_assert(std::is_trivially_copyable_v<InjectorDensity>,
"InjectorDensity must be trivially copyable");
static_assert(std::is_trivially_copyable<InjectorMomentum>::value,
static_assert(std::is_trivially_copyable_v<InjectorMomentum>,
"InjectorMomentum must be trivially copyable");
#endif

Expand Down
4 changes: 2 additions & 2 deletions Source/Particles/ParticleCreation/FilterCopyTransform.H
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*/
template <int N, typename DstPC, typename DstTile, typename SrcTile, typename Index,
typename TransFunc, typename CopyFunc,
amrex::EnableIf_t<std::is_integral<Index>::value, int> foo = 0>
amrex::EnableIf_t<std::is_integral_v<Index>, int> foo = 0>
Index filterCopyTransformParticles (DstPC& pc, DstTile& dst, SrcTile& src,
Index* mask, Index dst_index,
CopyFunc&& copy, TransFunc&& transform) noexcept
Expand Down Expand Up @@ -210,7 +210,7 @@ Index filterCopyTransformParticles (DstPC& pc, DstTile& dst, SrcTile& src, Index
*/
template <int N, typename DstPC, typename DstTile, typename SrcTile, typename Index,
typename TransFunc, typename CopyFunc1, typename CopyFunc2,
amrex::EnableIf_t<std::is_integral<Index>::value, int> foo = 0>
amrex::EnableIf_t<std::is_integral_v<Index>, int> foo = 0>
Index filterCopyTransformParticles (DstPC& pc1, DstPC& pc2, DstTile& dst1, DstTile& dst2, SrcTile& src, Index* mask,
Index dst1_index, Index dst2_index,
CopyFunc1&& copy1, CopyFunc2&& copy2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*/
template <int N, typename DstPC, typename DstTile, typename FAB, typename Index,
typename CreateFunc1, typename CreateFunc2, typename TransFunc,
amrex::EnableIf_t<std::is_integral<Index>::value, int> foo = 0>
amrex::EnableIf_t<std::is_integral_v<Index>, int> foo = 0>
Index filterCreateTransformFromFAB (DstPC& pc1, DstPC& pc2,
DstTile& dst1, DstTile& dst2, const amrex::Box box,
const FAB *src_FAB, const Index* mask,
Expand Down
4 changes: 2 additions & 2 deletions Source/Utils/Algorithms/IsIn.H
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace utils::algorithms
* @return true if elem is in vect, false otherwise
*/
template <typename TV, typename TE,
class = typename std::enable_if<std::is_convertible<TE,TV>::value>::type>
class = typename std::enable_if_t<std::is_convertible_v<TE,TV>>>
bool is_in(const std::vector<TV>& vect,
const TE& elem)
{
Expand All @@ -46,7 +46,7 @@ namespace utils::algorithms
* @return true if any element of elems is in vect, false otherwise
*/
template <typename TV, typename TE,
class = typename std::enable_if<std::is_convertible<TE,TV>::value>::type>
class = typename std::enable_if_t<std::is_convertible_v<TE,TV>>>
bool any_of_is_in(const std::vector<TV>& vect,
const std::vector<TE>& elems)
{
Expand Down

0 comments on commit aaf3cf0

Please sign in to comment.