Files
libconfig/build-config/reflect-cpp/include/rfl/internal/VisitorWrapper.hpp
Emily Boudreaux ec13264050 feat(reflect-cpp): Switched from glaze -> reflect cpp
A bug was discovered in glaze which prevented valid toml output. We have
switched to toml++ and reflect-cpp. The interface has remained the same
so this should not break any code
2025-12-06 10:55:46 -05:00

28 lines
703 B
C++

#ifndef RFL_INTERNAL_VISITORWRAPPER_HPP_
#define RFL_INTERNAL_VISITORWRAPPER_HPP_
#include "../Literal.hpp"
#include "../TaggedUnion.hpp"
#include "StringLiteral.hpp"
namespace rfl {
namespace internal {
/// Necessary for the VisitTree structure.
template <class Visitor, internal::StringLiteral... _fields>
struct VisitorWrapper {
/// Calls the underlying visitor when required to do so.
template <int _i, class... Args>
inline auto visit(const Args&... _args) const {
return (*visitor_)(name_of<Literal<_fields...>, _i>(), _args...);
}
/// The underlying visitor.
const Visitor* visitor_;
};
} // namespace internal
} // namespace rfl
#endif // RFL_VISIT_HPP_