|
Boost : |
Subject: Re: [boost] [string_ref] type erasure to support arbitrary strings
From: Andreas Pokorny (andreas.pokorny_at_[hidden])
Date: 2013-01-30 11:23:19
Hi
2013/1/30 Marshall Clow <mclow.lists_at_[hidden]>:
> On Jan 30, 2013, at 6:22 AM, Andreas Pokorny <andreas.pokorny_at_[hidden]> wrote:
>
>> Can the current proposal of string_ref capture QtStrings without copying?
>
> I haven't actually tried it, but after checking the QT docs, a
>
> QString str;
> basic_stringref<QChar> ref (str.data(), str.len());
QChar seems to be a class warpping a 16bit unicode character.
Then you can only use that for functions taking a
basic_string_ref<QChar> or functions templated on the encoding type.
That does fit to the use case .. the callee defines the signature.
Andreas
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk