idea: Templates + AJAX = breakthrough application

Robert Fraser fraserofthenight at gmail.com
Sun Nov 18 21:27:41 PST 2007


BCS wrote:
> Reply to Robert,
> 
>> I had this idea a while back, except I used a compile-time function
>> not a template.
>>
> 
> how could you do it with a function? How would you get to the argument 
> list of the function or the list of methods for an aggregate type? You 
> have a good point though, it would almost certainly need to use CTFE for 
> much of the work, the JavaScript if nothing else. Other parts (argument 
> and return value marshaling) would be better in pure template code. For 
> instance, I have a set of template functions somewhere that pack and 
> unpack up a unlimited depth of dynamic arrays into a byte array. It's 
> only about 30 lines of code and will suite for any type of dynamic array.
> 
> 

Mixins.

Having never actually used C++ templates, I feel a lot more comfortable 
writing

mixin(ctfeFunc(args))

than writing

templ!(args)

.



More information about the Digitalmars-d mailing list