Skip to content

Commit

Permalink
Merge pull request #961 from nicolasaunai/particle_werror
Browse files Browse the repository at this point in the history
werror particle may be uninitialized
  • Loading branch information
nicolasaunai authored Feb 21, 2025
2 parents 7f2a93d + 3000b70 commit f398041
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/data/particles/particle_packer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace PHARE::core
template<std::size_t dim>
class ParticlePacker
{
constexpr static Particle<dim> default_particle{};

public:
static constexpr std::size_t n_keys = 5;

Expand All @@ -28,11 +30,7 @@ class ParticlePacker
particle.delta, particle.v);
}

static auto empty()
{
Particle<dim> particle{};
return get(particle);
}
static constexpr auto empty() { return get(default_particle); }

// sometimes we use this to infer the size of an ParticleArray
// could be "charge" either
Expand Down Expand Up @@ -65,7 +63,7 @@ class ParticlePacker
private:
ParticleArray<dim> const& particles_;
std::size_t it_ = 0;
static inline const std::array<std::string, n_keys> keys_{"weight", "charge", "iCell", "delta",
static inline std::array<std::string, n_keys> const keys_{"weight", "charge", "iCell", "delta",
"v"};
};

Expand Down

0 comments on commit f398041

Please sign in to comment.