1

While trying to compile the latest version of MPC-HC (v1.7.3) I am getting an error I have not had before:

SeparableFilter.h(370): error C2059: syntax error : ';'

I get quite a few of these and it all seems to be on lines using the '= delete;' notation.

I am new to this notation however some Googling found it is part of the C++11 standard.

Is there a way to include support for this in VS2012 (using Ultimate, Update 4 currently)? Or is an upgrade to VS2013 required? (I presume it is supported in VS2013 as the MPC-HC developers use Visual C++, so am guessing VS2013!)

UPDATE: As requested, here is the surrounding code:

struct GaussianKernel {
    short* kernel;
    int width;
    int divisor;

    inline GaussianKernel(double sigma) {
        width = (int)(sigma * 3.0 + 0.5) | 1; // binary-or with 1 to make sure the number is odd
        if (width < 3) {
            width = 3;
        }
        kernel = DEBUG_NEW short[width];
        kernel[width / 2] = (short)(NormalDist(sigma, 0.0) * 255);
        divisor = kernel[width / 2];
        for (int x = width / 2 - 1; x >= 0; x--) {
            short val = (short)(NormalDist(sigma, width / 2 - x) * 255 + 0.5);
            divisor += val * 2;
            kernel[x] = val;
            kernel[width - x - 1] = val;
        }
    }

    inline ~GaussianKernel() {
        delete [] kernel;
    }

    GaussianKernel(const GaussianKernel&) = delete;
};
Damien
  • 1,647
  • 2
  • 16
  • 17
  • `GaussianKernel(const GaussianKernel&) = delete;`, but I am getting this error quite a few times and it's always when it uses `... = delete;` – Damien Apr 03 '14 at 15:35
  • 2
    Look at this [SO question](http://stackoverflow.com/questions/5513881/c-meaning-of-delete-after-function-declaration). The " = delete" notation is C++11 and VC 2013 is not C++11 AFAIK. – Jabberwocky Apr 03 '14 at 15:41
  • @MichaelWalz Thanks, I saw that question. Are you saying then that this notation cannot be used in VS2012 or VS2013? I wonder how the developers compiled it then...? – Damien Apr 03 '14 at 15:45
  • They build it with VS2013, the feature is possibly available there. – Roman R. Apr 03 '14 at 15:51
  • @RomanR. How annoying! Thanks for your response. Is there anyone who can confirm that the `... = delete;` notation works before I fork out for VS2013? – Damien Apr 03 '14 at 15:57
  • 1
    [Defaulted and deleted functions are supported in VS2013.](http://msdn.microsoft.com/en-us/library/hh567368.aspx#defaultedanddeleted) – Blastfurnace Apr 03 '14 at 16:03

0 Answers0