Add rfl::DefaultIfMissing; fixes #163, #167, #185 (#189)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2024-09-15 19:38:33 +02:00
committed by GitHub
parent dfc24ad932
commit 54c2a84650
12 changed files with 471 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef RFL_DEFAULTIFMISSING_HPP_
#define RFL_DEFAULTIFMISSING_HPP_
namespace rfl {
/// This is a "fake" processor - it doesn't do much in itself, but its
/// inclusion instructs the parsers to use the default values for missing
/// fields.
struct DefaultIfMissing {
public:
template <class StructType>
static auto process(auto&& _named_tuple) {
return _named_tuple;
}
};
} // namespace rfl
#endif