-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Began developing rfl::StripFieldNames
- Loading branch information
1 parent
d8549e8
commit 07bbb32
Showing
10 changed files
with
278 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef RFL_STRIPFIELDNAMES_HPP_ | ||
#define RFL_STRIPFIELDNAMES_HPP_ | ||
|
||
namespace rfl { | ||
|
||
/// This is a "fake" processor - it doesn't do much in itself, but its | ||
/// inclusion instructs the parsers to strip field names. | ||
struct StripFieldNames { | ||
public: | ||
template <class StructType> | ||
static auto process(auto&& _named_tuple) { | ||
return _named_tuple; | ||
} | ||
}; | ||
|
||
} // namespace rfl | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef RFL_INTERNAL_ISSTRIPFIELDNAMES_HPP_ | ||
#define RFL_INTERNAL_ISSTRIPFIELDNAMES_HPP_ | ||
|
||
#include <tuple> | ||
#include <type_traits> | ||
#include <utility> | ||
|
||
#include "../StripFieldNames.hpp" | ||
|
||
namespace rfl { | ||
namespace internal { | ||
|
||
template <class T> | ||
class is_strip_field_names; | ||
|
||
template <class T> | ||
class is_strip_field_names : public std::false_type {}; | ||
|
||
template <> | ||
class is_strip_field_names<StripFieldNames> : public std::true_type {}; | ||
|
||
template <class T> | ||
constexpr bool is_strip_field_names_v = | ||
is_strip_field_names<std::remove_cvref_t<std::remove_pointer_t<T>>>::value; | ||
|
||
} // namespace internal | ||
} // namespace rfl | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.