CbmRoot
Loading...
Searching...
No Matches
KfVisit.h File Reference

Optimized implementation of std::visit. More...

#include <variant>
Include dependency graph for KfVisit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  cbm
 
namespace  cbm::algo
 
namespace  cbm::algo::kf
 

Detailed Description

Optimized implementation of std::visit.

Author
Sergei Zharko s.zha.nosp@m.rko@.nosp@m.gsi.d.nosp@m.e
Since
27.07.2025
Note
For GNUC < 12 the run-time polymorphism built on std::variant with std::visit performs as badly, as one built with virtual inheritance. This header introduces a custom visit function, which deploys a templated if-else selection of the held alternative, which makes the variant-visit pattern performing faster.
The current implementation of the kf::visit accepts only one variant (TODO)

Definition in file KfVisit.h.