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.

Reply via email to