|
Proto : |
Subject: Re: [proto] vector of proto expressions
From: Karsten Ahnert (karsten.ahnert_at_[hidden])
Date: 2011-03-18 11:17:27
Hmm, this might work. It is similar to
my_method( fusion::make_vector( i+i , i*i*i , i*i ) , x );
But the expression might become really large, say 100 elements. A
separation between construction and usage would be nicer.
>>
>> In pseudo code it should look like this:
>>
>> Expressions< N > expressions;
>> construct( expressions ); // or something similar
>> do_step( epxressions , x ); // my method
>
>
> How about something like?
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> #include <boost/proto/proto.hpp>
>
> using namespace boost::proto;
>
> template<class Expr, class X>
> void my_method(Expr const& e, X const& x)
> {
> }
>
> int main()
> {
> using namespace boost::proto;
>
> terminal<int>::type i = {0};
> my_method( (i+i, i*i, i*i*i), 10);
> }
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Notice that you don't need to explicitly store the expressions in a
> container, you can just combine them in a larger expression tree which can
> be parsed in my_method.
>
> Nate
>
> This message and any attachments are intended only for the individual or
> entity to which the message is addressed. This is a private message and
> may contain privileged information. If you are neither the intended
> recipient nor the agent responsible for delivering the message to the
> intended recipient, you are hereby notified that any review,
> retransmission, dissemination, or taking of any action in reliance upon,
> the information in this communication is strictly prohibited, and may be
> unlawful. If you feel you have received this communication in error,
> please notify me immediately by returning this email to me and deleting it
> from your computer.
> _______________________________________________
> proto mailing list
> proto_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/proto
>
Karsten Ahnert
Ambrosys GmbH - Gesellschaft für Management komplexer Systeme
Geschwister-Scholl-Str. 63a
D-14471 Potsdam
Tel: +4917682001688
Fax: +493319791300
Ambrosys GmbH - Gesellschaft für Management komplexer Systems
Gesellschaft mit beschränkter Haftung
Sitz der Gesellschaft: Geschwister-Scholl-Str. 63a, 14471 Potsdam
Registergericht: Amtsgericht Potsdam, HRB 21228 P
Geschäftsführer: Karsten Ahnert, Dr. Markus Abel
Proto list run by eric at boostpro.com