Any ideas how one can achieve what is written in the subject line?

f below does achieve this but I one would expect that it produces
significant template bloat.

g achieves the aim but isn't very elegant.

    import std;
    void f(string file=__FILE__,size_t line=__LINE__,R...)(R r)
    {
      writeln(file,":",line," ",r);
    }
    void g(T)(T t,string file=__FILE__,size_t line=__LINE__)
    {
         writeln(file,":",line," ",t.expand);
    }

    void main()
    {
       f("hello ", 123);
       g(tuple("hello ",123));
    }

Reply via email to