Boost総合スレ part10 (385レス)
上下前次1-新
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん
リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
218(1): 2014/10/30(木)00:07 ID:lLBGJ4gC(1) AAS
>>214,217
いまさらだがわかった範囲で言っておくと
Inherited attributes に対する条件には
外部リンク[html]:www.boost.org
の
> Some parsers (e.g. primitives and non-terminals) may take in additional attributes. Such parsers take the form:
> p(a1, a2,..., aN)
> where p is a parser. Each of the arguments (a1 ... aN) can either be an immediate value, or a function, f, with signature:
> T f(Unused, Context)
> where T, the function's return value, is compatible with the argument type expected and Context is the parser's Context type
> (The first argument is unused to make the Context the second argument. This is done for uniformity with Semantic Actions).
があって
その immediate value の判定は boost::is_scalar か boost::spirit::traits::is_string のどちらかが真であるかで判定されてる。
けれど MyStruct はそのどちらにも該当しないので immediate value ではなくもちろん関数でもないから条件を満たさずエラーになる
>>217でやったように phoenix の val, ref でラップすれば function, f のほうで条件を満たすことができるのでエラーにはならない
ということだと思う
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ
ぬこの手 ぬこTOP 0.017s