<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-09-08 19:06 GMT+02:00 Aaron Levy <span dir="ltr"><<a href="mailto:aaron.levy@yandex.com" target="_blank">aaron.levy@yandex.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Does the boost::container::static_vector allocate its memory on the stack or heap. </blockquote><div><br></div><div>Same as plain old int - where does int allocate its memory? It does not allocate. It just resides wherever you define it to be.<br></div><div><br></div><div>The memory for elements of static_vector is inside the static_vector object itself. When you put your object on the stack, the memory is on the stack.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">From what I could make of the code, it seems to allocate on the stack. What happens if the requested size exceeds the stack size limits?<br><br> Aaron<br></blockquote><div><br></div><div>When an object doesn't fit on the stack (no matter if it's a static_vector instance or a plain old int), you typically get a stack overflow error and your program crashes.</div><div><br></div><div>HTH,</div><div>Kris</div></div></div></div>