Opened 6 years ago

Last modified 6 years ago

#12344 new Bugs

boost::fusion::extension::struct_member_name doesn't work with a const sequence

Reported by: Benoit Blanchon <benoit@…> Owned by: Joel de Guzman
Milestone: To Be Determined Component: fusion
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

Here is the code to reproduce the bug:

struct Hello { int World; };

BOOST_FUSION_ADAPT_STRUCT(Hello, World);

int main() {
    using Seq = const Hello; // <- works when const is removed
    std::cout << boost::fusion::extension::struct_member_name<Seq, 0>::call();
}

Link to wandbox

As stated in the comment, the code works fine when const is removed.

I think that struct_member_name should call std::remove_const or std::remove_cv.

Change History (3)

comment:1 by Kohei Takahashi, 6 years ago

AFAIK, boost::fusion::extension namespace is not for user code. Joel, any suggestion?

comment:2 by Joel de Guzman, 6 years ago

Not sure if I understand... what is the relevance of boost::fusion::extension here?

comment:3 by Kohei Takahashi, 6 years ago

Most of (I think all of) public interfaces uses fusion::extension with remove_const, i.e. it is not necessary to use remove_const within fusion::extension; I suspect fusion::extension is internal use only. However there is no public interface which counterpart of extension::struct_member_name, thus user wants remove_const to be applied to extension::struct_member_name.

IMO, it is by design, i.e. wontfix.

Note: See TracTickets for help on using tickets.