Re: Linking error when changing > to >>

Seth <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 17-11-16 18:52, Larry Evans wrote:
> that r_attr has a type that looks like a
> std::string::const_iterator, which has got to be wrong.

Yes that sounds wrong. The actual type is the one I instantiate in this
workaround I showed on Larry's request:

https://github.com/sehe/linker_error_example/commit/021b36105e010b9134b76cdf8b47952589d5fff8

namespace {
    template <typename Seq, size_t N>
        using field_at =
boost::fusion::basic_iterator<boost::fusion::struct_iterator_tag,
boost::fusion::random_access_traversal_tag, Seq, N>;
    template <typename Seq, size_t N, size_t M>
        using fields   = boost::fusion::iterator_range<field_at<Seq, N>,
field_at<Seq, M> >;

    using Attributes = fields<client::ast::VariableDec, 1, 2>;
    using Context  = x3::context<x3::skipper_tag,
x3::char_class<boost::spirit::char_encoding::ascii, x3::space_tag>
const, x3::unused_type>;
}

template bool parse_rule<std::string::const_iterator, Context,
fields<client::ast::VariableDec, 1, 2> >(
    decltype(type),
    std::string::const_iterator &,
    std::string::const_iterator const &,
    Context const &,
    Attributes &);

}}

Here `Attributes` is a Fusion iterator range (of 1 element), which
happens to, surprise, describe the second member of
`client::ast::VariableDec`. The above is merely the humanized
"descriptive" spelling of the types in the linker error.

See my older post here
<http://boost.2283326.n4.nabble.com/Linking-error-when-changing-gt-to-gt-gt-tt4689820.html#a4689860>
for the reason why the linker error occurs

Seth

------------------------------------------------------------------------------

_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.