Boost総合スレ part10at TECH
Boost総合スレ part10 - 暇つぶし2ch217:デフォルトの名無しさん
14/10/30 00:07:58.69 lLBGJ4gC.net
>>213,217
いまさらだがわかった範囲で言っておくと

Inherited attributes に対する条件には
URLリンク(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 ではなくもちろん関数でもないから条件を満たさずエラーになる
>>216でやったように phoenix の val, ref でラップすれば function, f のほうで条件を満たすことができるのでエラーにはならない
ということだと思う


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch