
----- Original Message ----- From: "Joel de Guzman" <joel@boost-consulting.com> To: <boost-users@lists.boost.org> Sent: Monday, January 25, 2010 8:55 PM Subject: Re: [Boost-users] BOOST_FUSION_ADAPT_STRUCT: non intrusive macro, get a fusion sequence of struct member types and member names
On 1/25/2010 6:54 PM, joel falcou wrote:
struct_member_name_at/at_c< index, struct_adapted_as_fusion_sequence > hmm, it's the same problem with the const char*
Is there no way to provide the member names at compile time? There must be something obvious and I am just not seeing it. name will obviously be char* and you can't have that in a template
Hicham Mouline wrote: parameter. Best shot is to generate types with name looking like member name.
I think it should just be simple functions:
template <int N, typename Sequence> char const* name_at_c(Sequence const& seq);
template <typename N, typename Sequence> char const* name_at(Sequence const& seq);
There should be a compile error if Sequence has no named members. Some types of sequences may implement it through a customization point (same scheme that at_c and friends use).
The function argument would not be necessary, wouldn't it? All the information is available in the type Sequence. template <int N, typename Sequence> char const* name_at_c(); This would then be at runtime, not compile time?. rds,