search for: assignto

Displaying 3 results from an estimated 3 matches for "assignto".

2011 Jul 24
0
[LLVMdev] Correct use of StringRef and Twine
...Twine into a std::string - while the change to Triple's ctor works because returning a std::string from a function into a ctor can do fancy in-place construction - in any other case like "SetFoo(const Twine& t) { this->s = t; }" we'd want something better. Perhaps simply t.AssignTo(s); 2) This one isn't quite as fleshed out, but see if the general outline makes sense: Introduce an extra type that's Twine-esque, but is only the top level (so it's implicitly constructible from a const Twine&), rather than all the branches of a Twine. If a function wants to acce...
2011 Jul 23
2
[LLVMdev] Correct use of StringRef and Twine
On Jul 22, 2011, at 2:59 PM, David Blaikie wrote: >> The dangerous part of this is that characters are integers, so "foo" + 'x' is very likely to cause serious problems. > > std::string already provides such overloads though, doesn't it? So the > code isn't any safer from accidental "foo" + 'x' expressions that > don't include
2011 Jul 24
2
[LLVMdev] Correct use of StringRef and Twine
...- > while the change to Triple's ctor works because returning a > std::string from a function into a ctor can do fancy in-place > construction - in any other case like "SetFoo(const Twine& t) { > this->s = t; }" we'd want something better. Perhaps simply > t.AssignTo(s); Adding a Twine::assignTo method would make sense to me! > 2) This one isn't quite as fleshed out, but see if the general outline > makes sense: Introduce an extra type that's Twine-esque, but is only > the top level (so it's implicitly constructible from a const Twine&amp...