enable_if template param is lambda (with particular signature)
问题 I have something this: template<typename T> class Image { Image(int w, int h, T defaultVal){ for(int i=0; i<h; i++) for(int j=0; j<w; j++) pixel(j, i) = defaultVal; } template<typename F> Image(int w, int h, F initializer){ for(int i=0; i<h; i++) for(int j=0; j<w; j++) pixel(j, i) = initializer(j, i); } // ... }; My intention is to be able to instantiate an Image like this: Image<int> img0(w, h, 0); // image of zeroes Image<int> imgF(w, h, [](int j, int i){ // checkerboard image return (j/10