src/LinuxTracing/PerfEvent.cpp
void PerfEvent::Accept(PerfEventVisitor* visitor) const {
  std::visit([event_timestamp = timestamp,
              visitor](auto&& event_data) { visitor->Visit(event_timestamp, event_data); },
             data);
}
// This is a non-traditional way of implementing the visitor pattern. The use of `std::variant`
// instead of a regular class hierarchy is motivated by the fact that this saves us from heap
// allocating objects, which turns out to be more expensive than copying.
This is a non-traditional way of implementing the visitor pattern. The use of `std::variant`
instead of a regular class hierarchy is motivated by the fact that this saves us from heap
allocating objects, which turns out to be more expensive than copying.
This is a non - traditional way of implementing the visitor pattern . The use of ` std :: variant ` instead of a regular class hierarchy is motivated by the fact that this saves us from heap allocating objects which turns out to be more expensive than copying .
void PerfEvent::Accept(PerfEventVisitor* visitor) const {
  std::visit([event_timestamp = timestamp,
              visitor](auto&& event_data) { visitor->Visit(event_timestamp, event_data); },
             data);
}
void PerfEvent :: Accept ( PerfEventVisitor * visitor ) const { std :: visit ( [ event_timestamp = timestamp , visitor ] ( auto && event_data ) { visitor -> Visit ( event_timestamp , event_data ) ; } , data ) ; }
This is a non-traditional way of implementing the visitor pattern.
This is a non - traditional way of implementing the visitor pattern .