Thread overview
Using auto_buffer for a stack-based allocator for std::string
Sep 23, 2012
Adi Shavit
Oct 06, 2012
Matt Wilson
Oct 14, 2012
Adi Shavit
September 23, 2012
Hi,

  I need a (mostly) stack-based string.
I was wondering if it'd bee possible to use auto_buffer as the underlying component of an allocator that can be given to an std::string.
This way I can use these string with functions that accept and expect on std::string and still reap the benefits of stack access when my strings are not too big.

Has anyone done this before?
Does anyone have guidelines as to how to do this?

Thanks,
Adi

October 06, 2012
I did some work on similar lines when I was researching XSTL, for the material that was put back and later intended for XSTLv2 (when/if ever that happens). Bit rusty on it now, but it was _possible_; very ugly though.

Have you thought about using stlsoft::basic_static_string?

"Adi Shavit" <adishavit_thisDoesNotBelongHere_@gmail.com> wrote in message news:fowovkjjozrugnbalqrh@forum.dlang.org...
> Hi,
>
>   I need a (mostly) stack-based string.
> I was wondering if it'd bee possible to use auto_buffer as the underlying
> component of an allocator that can be given to an std::string.
> This way I can use these string with functions that accept and expect on
> std::string and still reap the benefits of stack access when my strings
> are not too big.
>
> Has anyone done this before?
> Does anyone have guidelines as to how to do this?
>
> Thanks,
> Adi
> 


October 14, 2012
Thanks.
I'll check out stlsoft::basic_static_string.
Adi

On Saturday, 6 October 2012 at 08:51:57 UTC, Matt Wilson wrote:
> I did some work on similar lines when I was researching XSTL, for the
> material that was put back and later intended for XSTLv2 (when/if ever that
> happens). Bit rusty on it now, but it was _possible_; very ugly though.
>
> Have you thought about using stlsoft::basic_static_string?
>
> "Adi Shavit" <adishavit_thisDoesNotBelongHere_@gmail.com> wrote in message
> news:fowovkjjozrugnbalqrh@forum.dlang.org...
>> Hi,
>>
>>   I need a (mostly) stack-based string.
>> I was wondering if it'd bee possible to use auto_buffer as the underlying component of an allocator that can be given to an std::string.
>> This way I can use these string with functions that accept and expect on std::string and still reap the benefits of stack access when my strings are not too big.
>>
>> Has anyone done this before?
>> Does anyone have guidelines as to how to do this?
>>
>> Thanks,
>> Adi