[proto]constraints between context result type and context's::eval::operator result_type?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[proto]constraints between context result type and context's::eval::operator result_type?

Larry Evans
Instead of a context derived from proto::callable_context<.>,
I've had to define one with nested eval templates; however,
some of the nested eval::operator()(Expr,Context) specializations
have different result_type's than the containing context.
What are the constraints between the two?  I've inferred
from looking at the examples on:

http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost_proto/users_guide/hello_calculator.html

that they must be the same; however, I've just compiled code
where they're not.

TIA.

-regards,
Larry


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [proto]constraints between context result type and context's::eval::operator result_type?

Eric Niebler

Larry Evans wrote:

> Instead of a context derived from proto::callable_context<.>,
> I've had to define one with nested eval templates; however,
> some of the nested eval::operator()(Expr,Context) specializations
> have different result_type's than the containing context.
> What are the constraints between the two?  I've inferred
> from looking at the examples on:
>
> http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost_proto/users_guide/hello_calculator.html
>
> that they must be the same; however, I've just compiled code
> where they're not.

They need not be the same, and they are often not. No requirements here.
I have yet to write the "Expression Evaluation" section of the docs
where I describe contexts in detail, and I'll be sure to mention this
when I do.

--
Eric Niebler
Boost Consulting
www.boost-consulting.com

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel