@@ -40,7 +40,7 @@ template<size_t dim>
40
40
struct Particle
41
41
{
42
42
static_assert (dim > 0 and dim < 4 , " Only dimensions 1,2,3 are supported." );
43
- static const size_t dimension = dim;
43
+ static size_t const dimension = dim;
44
44
45
45
Particle (double a_weight, double a_charge, std::array<int , dim> cell,
46
46
std::array<double , dim> a_delta, std::array<double , 3 > a_v)
@@ -57,9 +57,10 @@ struct Particle
57
57
double weight = 0 ;
58
58
double charge = 0 ;
59
59
60
- std::array<int , dim> iCell = ConstArray<int , dim>();
61
- std::array<double , dim> delta = ConstArray<double , dim>();
62
- std::array<double , 3 > v = ConstArray<double , 3 >();
60
+ // {} zero initialization
61
+ std::array<int , dim> iCell{};
62
+ std::array<double , dim> delta{};
63
+ std::array<double , 3 > v{};
63
64
64
65
NO_DISCARD bool operator ==(Particle<dim> const & that) const
65
66
{
@@ -121,9 +122,9 @@ inline constexpr auto is_phare_particle_type
121
122
122
123
template <std::size_t dim, template <std::size_t > typename ParticleA,
123
124
template <std::size_t > typename ParticleB>
124
- NO_DISCARD typename std::enable_if_t <
125
- is_phare_particle_type<dim, ParticleA<dim>> and is_phare_particle_type<dim, ParticleB<dim>>,
126
- bool >
125
+ NO_DISCARD typename std::enable_if_t <is_phare_particle_type<dim, ParticleA<dim>>
126
+ and is_phare_particle_type<dim, ParticleB<dim>>,
127
+ bool >
127
128
operator ==(ParticleA<dim> const & particleA, ParticleB<dim> const & particleB)
128
129
{
129
130
return particleA.weight == particleB.weight and //
0 commit comments