Erick Tryzelaar
2009-Aug-11 08:59 UTC
[LLVMdev] Should APFloat's construct-from-string take a string length?
I noticed that APInt's construct-from-string takes the length of the string, but APFloat does not. Would it make sense to modify APFloat to also take a length? I would imagine that it'd help protect us against malformed string values. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090811/1f19e9a2/attachment.html>
Daniel Dunbar
2009-Aug-11 15:08 UTC
[LLVMdev] Should APFloat's construct-from-string take a string length?
On Tue, Aug 11, 2009 at 1:59 AM, Erick Tryzelaar<idadesub at users.sourceforge.net> wrote:> I noticed that APInt's construct-from-string takes the length of the string, > but APFloat does not. Would it make sense to modify APFloat to also take a > length? I would imagine that it'd help protect us against malformed string > values.This sounds reasonable to me. Note that you can change them both to take a const StringRef& and get the standard variants (std::string, const char*, ptr + size) for free. - Daniel