
3 May
2013
3 May
'13
1:33 p.m.
On 05/02/2013 07:52 PM, John M. Dlugosz wrote:
I recall some "detail" code in Boost that does exactly what I want: allocate a probably-good-enough size on the stack but switch to heap if needed. But I can't remember where I saw it.
Looking around, I came across mentions of Boost.AutoBuffer by Thorsten Ottosen, but all links are dead.
I think the loki smallstringOpt class will do what you want to do. It initially allocates storage on the stack but if the string grows beyond the initial allocation it switches to heap storage. Dave Riedel