this kind of thing doesn't work super well due to the nature of compile time. My suggestion is to put the checks and the implementation in separate things.

void foo(T...)() {
    static bool checkHelper() {
        bool passed;
        static foreach(t; T) {
            static if(is(t == whatever)) {
                  passed = false;
            }
        }
        return passed;
    }

    static assert(checkHelper());

    // then foreach to do the rest of it
}


something like that. maybe returning string instead of bool to have an error message you print out with the static assert.

i don't love this but it is the simplest way I know.

Reply via email to