In addition. The code never issued when I compile it using Visual Studio
2013. The bug appeared only after emscripten compilation.

I am using emscripten 1.30

On Thu, Aug 27, 2015 at 10:43 AM, Sergey Solozhentsev <
[email protected]> wrote:

> Hi
> Today I met strange issue. When I try to use std::initializer_list in
> emscripten it pass strange values to calling method. e.g.
>
> I have following line
> *CPooledArray<Cell> startCells= { cell1.getCell(), cell2.getCell() };*
>
> that calls
>
> *CPooledArray(std::initializer_list<T> list) *
> * {*
> * reserve(list.size());*
> * for (auto i = list.begin(); i != list.end(); i++)*
> * {*
> * push_back(*i);*
> * }*
> * }*
> the issue that *list.size()* returns very large values sometimes. I was
> trying to reproduce this issue in test project but I failed. Probably it
> because my project use memory allocation a lot.
>
> I fixed the issue in my code in the following way
>
> *CPooledArray<Cell> startCells;*
> *startCells.push_back(pElement1->getCell());*
> *startCells.push_back(pElement2->getCell());*
>
> and it works fine.
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to