boostorg / boostorg/fusion

Get member name of sequence defined by BOOST_FUSION_DEFINE_STRUCT_INLINE

Open
#202 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
50
Forks
68
PR merge metrics
No merged PRs in 30d

Description

I need to get member name of the sequence. The code bellow works for BOOST_FUSION_DEFINE_STRUCT but doesn't for BOOST_FUSION_DEFINE_STRUCT_INLINE. I get compiler error:
``error: incomplete type ‘boost::fusion::extension::struct_member_name’ used in nested name specifier``.

```cpp
#include
#include
#include
``
// it works
BOOST_FUSION_DEFINE_STRUCT(, Employee, (std::string, name)(int, age))

// compile error
//BOOST_FUSION_DEFINE_STRUCT_INLINE(Employee, (std::string, name)(int, age))

int main() {
auto size = boost::fusion::extension::struct_size::value;
std::cout << size << std::endl;

auto name = boost::fusion::extension::struct_member_name::call();
std::cout << name << std::endl;
}
```

It says in doc ``BOOST_FUSION_DEFINE_STRUCT_INLINE is a macro that can be used to generate all the necessary boilerplate to define and adapt an arbitrary struct as a model of Random Access Sequence. Unlike BOOST_FUSION_DEFINE_STRUCT, it can be used at class or namespace scope.``. It sounds that both of them define sequence with the same functionality.
Could you help?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.