Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [fb2k API request] Move constructor/operator= for pfc::string8_t<> (Read 2593 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[fb2k API request] Move constructor/operator= for pfc::string8_t<>

Here is some examples that show the use of this feature:

Code: [Select]
pfc::string8 myMethod()
{
  pfc::string8 str;
  ...
  // this would result in a copy constructor now, but it would be
  // a move constructor, which is much more friendly performance-wise
  return str;
}

void myMethod2()
{
   std::vector<pfc::string8> myVec;
   ...
   // makes a lot of copies currently, which could make a huge impact on performance when there are lot of strings.
   // move constructor/assignment operator would remove the cost of moving objects around
   myVec.sort();
   ...
}

It should be 'noexcept' as well for most optimizations to work though.

Re: [fb2k API request] Move constructor/operator= for pfc::string8_t<>

Reply #1
I would in general recommend just using std::string in new code, unless pfc one is specifically needed for some feature that it provides.
Microsoft Windows: We can't script here, this is bat country.

 

Re: [fb2k API request] Move constructor/operator= for pfc::string8_t<>

Reply #2
pfc::string_8 handles utf8 string correctly: last time I tried using std::string instead it resulted in multiple number of glitches...
I will try std::string again, but I'm not holding my breath =)