<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 6, 2016 at 3:55 PM, Kurt Schwehr <span dir="ltr"><<a href="mailto:schwehr@gmail.com" target="_blank">schwehr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I was not intending for C++11 to be a big part of the discussion as it is a much more complicated topic, but I do appreciate the discussion.  I picked the stack + memset -> std::vector(nSize, initialValue) to do first because I thought it was a simpler issue than most and we could use it to figure out how to go about these sorts of discussions.  It's not a show stoper, but it is a real need.<div><br></div><div>At this point, I think it would be good if we could pause the C++11 discussion for a bit and back up to the original question.</div><div><br></div><div>I'd like to ask folks a couple of things:</div><div><br></div><div>- If you could stack rank (all or some) the options assuming that C++14 was available</div><div>- Is your top pick far better than the rest or just a little better?</div><div>- Are there any options that you think should not be used in GDAL?</div><div>- Are there any reasons to be for or against any particular alternative that we need to call out?</div></div></blockquote><div><br></div><div>Doing a heap-based array is simple.  You can pretty-much copy the std::array code from the standard library and introduce the indirection you require.  It's better than a vector for the reasons you already mentioned. Something that looks and acts like an array is better than a vector because it makes the use clear.  If you have C++ 11 you can simply wrap std::array.  C++03 has value initialization for arrays: new int[10]();, so that's another alternative.</div><div><br></div></div>-- <br><div>Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div>
</div></div>