A good advertisement for 'static if'

2013-12-12 Thread Craig Dillabaugh
I am not sure if this belongs in D.learn, but it might be of interest. I was writing some C++ code for a project at work and have a class that stores image data from a file. The image data can be in just about any numeric (int/float/complex) type, so I wanted a 'wrapper' class/struct that

Re: A good advertisement for 'static if'

2013-12-12 Thread FreeSlave
On Thursday, 12 December 2013 at 14:55:28 UTC, Craig Dillabaugh wrote: I am not sure if this belongs in D.learn, but it might be of interest. I was writing some C++ code for a project at work and have a class that stores image data from a file. The image data can be in just about any numeric

Re: A good advertisement for 'static if'

2013-12-12 Thread FreeSlave
With some improvements you also can provide compile-time error about instantiation of non-specialized function (i.e. which has T as parameter), but I'm not sure what's good way to do it in C++.

Re: A good advertisement for 'static if'

2013-12-12 Thread Craig Dillabaugh
On Thursday, 12 December 2013 at 17:34:13 UTC, FreeSlave wrote: On Thursday, 12 December 2013 at 14:55:28 UTC, Craig Dillabaugh wrote: I am not sure if this belongs in D.learn, but it might be of interest. I was writing some C++ code for a project at work and have a class that stores image