On Thu, 06 Jan 2011 12:49:19 -0500, Max Samukha
wrote:
Some of us who have the knack of writing metaprograms in D know that
many algorithms can be implemented with both recursive templates and
CTFE. A simple example is map:
Recursive template instantiation:
template staticMap(alias pred
On 01/07/2011 03:12 PM, Don wrote:
Max Samukha wrote:
On 01/06/2011 09:28 PM, Robert Clipsham wrote:
Put each of those implementations in its own file, then call it several
times. Look at the binary size for each implementation, also run
`strings ctfeTest` if you're on a *nix. This should give
Max Samukha wrote:
On 01/06/2011 09:28 PM, Robert Clipsham wrote:
Put each of those implementations in its own file, then call it several
times. Look at the binary size for each implementation, also run
`strings ctfeTest` if you're on a *nix. This should give you your
answer :)
The problem
On 01/06/2011 09:28 PM, Robert Clipsham wrote:
Put each of those implementations in its own file, then call it several
times. Look at the binary size for each implementation, also run
`strings ctfeTest` if you're on a *nix. This should give you your answer :)
The problem is they are not easy
Actually they are not that related, you may solve a problem with each of
them but this is different.
What makes CTFE awesome is that you use same function for runtime and
compile-time, without a single change.
The answer to your question is just in this very definition i believe.
It is not ea
On 06/01/11 17:49, Max Samukha wrote:
Some of us who have the knack of writing metaprograms in D know that
many algorithms can be implemented with both recursive templates and
CTFE. A simple example is map:
Recursive template instantiation:
template staticMap(alias pred, A...)
{
static if (A.le
On Thursday, January 06, 2011 09:49:19 Max Samukha wrote:
> Some of us who have the knack of writing metaprograms in D know that
> many algorithms can be implemented with both recursive templates and
> CTFE. A simple example is map:
>
> Recursive template instantiation:
>
> template staticMap(ali
On Thu, 06 Jan 2011 12:49:19 -0500, Max Samukha
wrote:
Some of us who have the knack of writing metaprograms in D know that
many algorithms can be implemented with both recursive templates and
CTFE. A simple example is map:
Recursive template instantiation:
template staticMap(alias pred
On 01/06/2011 07:49 PM, Max Samukha wrote:
template staticMap(alias pred, A...)
{
static if (A.length)
alias TypeTuple!(pred!(A[0]), staticMap!(A[1..$])) staticMap;
}
Should be:
template staticMap(alias pred, A...)
{
static if (A.length)
alias TypeTuple!(pred!(A[0]), staticMap!(A[
Some of us who have the knack of writing metaprograms in D know that
many algorithms can be implemented with both recursive templates and
CTFE. A simple example is map:
Recursive template instantiation:
template staticMap(alias pred, A...)
{
static if (A.length)
alias TypeTuple!(pr
10 matches
Mail list logo