www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Phobos Help Request: Aliases and CTFE

This is a help request for a pull I am working on:

It is just a basic templated struct.

The issue I'm having comes from this line (1069), where I am 
trying to define a compile-time string:
enum string seedExceptionText = text("LaggedFibonacciEngine.seed: 
Input range didn't provide"
" enough elements: Need ", longLag, " elements.");
Note: longLag is a template parameter of type size_t.

This line, in and out of itself, works. The problem is that once 
I declare my "generators with well-chosen parameters" aliases, 
all hell breaks loose:
alias LaggedFibonacciEngine!(double, 48,   607,   273)   
alias LaggedFibonacciEngine!(double, 48,  1279,   418)  
alias LaggedFibonacci607 LaggedFibonacci;

Here is the diff where I *removed* these aliases:

After removing them, these compilation errors seized to exist 
(different messages on different machines):
The error message, in a word, is:
std/conv.d(3040): Error: template std.conv.text(T...) forward 
reference to template text(T...)
Which originate from the alias declarations.

What does "forward reference" even mean in this context?

The (very?) strange parts here I am having trouble wrapping my 
head around is that std.random compiles and unittests fine. It is 
actually std.algorithm that is having trouble importing 
std.random, when trying to instantiate(?) the aliases...

I really could use a bit of enlightenment here...
Sep 05 2012