How to pass list of strings as compile-time parameters?

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Apr 24 10:47:53 PDT 2012


On Tue, Apr 24, 2012 at 07:39:42PM +0200, Trass3r wrote:
> >	bool compareByMemb(string[] ignores, T)(T obj1, T obj2) {
> >		foreach (name; __traits(getAllMembers, T)) {
> >			...
> >		}
> 
> In this particular case you could try
> 
> foo(T, U...)(T obj1, T obj2, U ignores)

Sure, but U always string. Though I suppose I *could* use a signature
constraint to enforce that...


T

-- 
Guns don't kill people. Bullets do.


More information about the Digitalmars-d-learn mailing list