New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qi: Ambiguity in transform_attribute trait at dealing with Fusion ADT #396

Closed
Kojoley opened this Issue Sep 8, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@Kojoley
Collaborator

Kojoley commented Sep 8, 2018

#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/support_adapt_adt_attributes.hpp>

struct Vec2i
{
    int x;
    int y;
};

BOOST_FUSION_ADAPT_ADT(
    Vec2i,
    (int, int, obj.x, obj.x = val)
    (int, int, obj.y, obj.y = val)
)

int main()
{
    namespace qi = boost::spirit::qi;

    qi::rule<char const*, Vec2i()> v1 = qi::uint_ >> ',' >> qi::uint_; // OK

    qi::rule<char const*, int()> coord = qi::uint_;
    qi::rule<char const*, Vec2i()> v2 = coord >> ',' >> coord; // Fails to compile
}
boost\spirit\home\qi\detail\attributes.hpp(154): error C2752: 'boost::spirit::traits::transform_attribute<Exposed,Transformed,boost::spirit::qi::domain,void>': more than one partial specialization matches the template argument list
        with
        [
            Exposed=boost::fusion::extension::adt_attribute_proxy<Vec2i,0,false>,
            Transformed=int
        ]
boost\spirit\home\qi\detail\attributes.hpp(154): note: could be 'boost::spirit::traits::transform_attribute<Exposed,Transformed,boost::spirit::qi::domain,void>'
boost\spirit\home\qi\detail\attributes.hpp(154): note: or       'boost::spirit::traits::transform_attribute<boost::fusion::extension::adt_attribute_proxy<T,N,false>,Attribute,Domain,disable_if<boost::is_reference<fusion::extension::adt_attribute_proxy<T,N,false>::type>,void>::type>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment