Boost logo

Boost Users :

Subject: Re: [Boost-users] Crash in VS2013, bug in compiler, boost or my code ? (flyweight, variant and initializer list)
From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2013-12-14 07:30:08

El 14/12/2013 2:03, Andreas M. Iwanowski escribió:
>> Probably related to this: it's appears to be a known (and pretty serious IMO) bug in the compiler.
>> The report has to do with CString, but an SO blog explains how the compiler is treating temporaries.
>> Plausible workaround: avoid initializer lists, especially of VS20XX is your target.
>> Other than that, HTH and good luck.
> +1 for digging this out.
> This is a really nasty compiler bug indeed.
> It would indeed make sense, since string_flyweight is the complex type where the compiler would trash the memory.
> You could try with other types just to verify, but this indeed seems to be the compiler's fault and not yours.

I haven't tried, but maybe replacing the problematic initialization with

   std::vector<Variant> v = { 1., true, "toto"};

can work around the compiler bug (can't try myself), in case it helps

Joaquín M López Muñoz
Telefónica Digital


Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at:

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at