Re: Linking error when changing > to >>

Larry Evans <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 11/20/2016 12:21 PM, Exagon wrote:
> Besids the linking errors when switch from > to >> in this example, I am
> getting a lot of linker errors, when I try to use boost::optional as a
> member of an attribute
>
> for example when I change
>
> auto const var_dec_def = x3::lexeme["var "]
>                          > +x3::alnum
>                          > ":"
>                          > type
>                          > ";";
>
> to
>
> auto const var_dec_def = x3::lexeme["var "]
>                          > +x3::alnum
>                          > ":"
>                          > -type //type is now optional
>                          > ";";
>
> and dont change something in the ast, it compiles fine, but when I change
>
> struct VariableDec {
>     std::string _name;
>     Type _type;
> };
>
> to
>
> struct VariableDec {
>     std::string _name;
>     boost::optional<Type> _type;
> };
>
> I am getting a linking error again.
> Is this a bug or am I doing soemthing stupid?
> If this is a totaly different topic, I will invest some time and create
> another repo with a more minimal example to show my problem with this.
>
> Greetings Exagon

Try the latest update here:

https://github.com/cppljevans/spirit/blob/ExagonLinkingError/include/boost/spirit/home/x3/nonterminal/rule.hpp

Unfortunately, I've no idea how many more extract_rule_attr overloads
may be needed to handle all situations.  I don't even know if the
use of extract_rule_attr overloads is correct (it may handle the
attributes differently than "standard" boost).  I'm still trying
to understand how attributes are handled in boost code. I can read
the user documentation; however, I still need to read the code
to see how it's done, and that's taking a while :(

If you have another similar problem, try to figure out another
extract_rule_attr to handle it.  Otherwise, maybe Seth or Joel
would have a better idea how to handle this.

-regards,
Larry




------------------------------------------------------------------------------
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.