[phobos] More tuple algorithms with std.meta

Shin Fujishiro rsinfu at gmail.com
Sun Sep 26 23:17:19 PDT 2010


I'm willing to add more tuple algorithms to phobos for easing
metaprogramming in D.  Here's code and example:

  http://gist.github.com/598659

----------
alias staticSort!(
        q{ a.at!(0).sizeof < b.at!(0).sizeof },
        staticZip!( Wrap!(int, double, byte),
                    Wrap!("x", "y", "z")))
      A;
pragma(msg, A);
// tuple(Wrap!(byte,"z"),Wrap!(int,"x"),Wrap!(double,"y"))
----------

Built-in tuples have been able to store non-type compile-time entities.
So, I propose we should rename the current TypeTuple to StaticTuple,
and gather generic (non-type specific) tuple algorithms into a new
module: std.meta.

Does it sound good?


Shin


More information about the phobos mailing list