Skip to main content
1 of 2
Deduplicator
  • 19.9k
  • 1
  • 32
  • 65
  1. Avoid owning raw pointers. Even without exceptions, they are prone to leak.
    Use a sensible std::unique_ptr, std::any or std::variant. The latter even avoid extra dynamic allocations, though at the cost of potentially wasting a small amount of memory.

  2. Are you sure there's always at least one person?

Deduplicator
  • 19.9k
  • 1
  • 32
  • 65