can I get public alias to private templates?
BCS
ao at pathlink.com
Thu May 17 19:45:35 PDT 2007
Reply to Chris Nicholson-Sauls,
> I don't know of any way to expose public names for private things in
> quite that way, but you might consider something like this:
>
> private void goT(T)(T v){
> static if (!(is(T == int) || is(T == char) || is(T == byte) || is(T
> == float))) {
> static assert (false, "...useful message...");
> }
> // ... code ...
> }
> Not super pretty, I know, but it should work. It would be nice if
> there were a cleaner way of doing this for those cases where the list
> is long. (I have something I would've liked to templatize in a
> similar fashion, but with about 10 types to support.)
>
Yeah, I guess I could do that. But I also have a bunch of other stuff that
would have to be checked. I guess I could make it all public and then make
threats against the lives on anyone who uses the template directly. :b
More information about the Digitalmars-d-learn
mailing list