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.
>> http://connect.microsoft.com/VisualStudio/feedback/details/800104/
>> The report has to do with CString, but an SO blog explains how the compiler is treating temporaries.
>> http://stackoverflow.com/questions/19269345/initializing-map-of-maps-with-initializer-list-in-vs-2013
>> 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
somehow.

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:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net