Alternative way to adapt struct?
- Dominant language
- C++
- Stars
- 50
- Forks
- 68
- PR merge metrics
- No merged PRs in 30d
Description
Why not make it possible to adapt structures in an alternative way (not only through `BOOST_FUSION_ADAPT_STRUCT`)? For example, like this:
```
namespace demo
{
struct employee
{
std::string name;
int age;
};
}
// demo::employee is now a Fusion sequence
namespace boost { namespace fusion {
namespace adapted {
constexpr auto tie_members(const demo::employee& x) noexcept {
return std::tie(x.name, x.age);
}
}
}}
```
or, like this:
```
namespace demo
{
struct employee
{
std::string name;
int age;
constexpr auto tie_members() const noexcept {
return std::tie(name, age);
}
};
}
```
Does this fit into the Boost Fusion library? Does it make sense to create a PR? Even if no one uses this feature, it will somehow reduce the amount of code in https://github.com/boostorg/fusion/pull/243, and possibly speed up its review.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.