CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Codeplug

Search: Search took 0.18 seconds.

  1. Re: std::string to std::vector with terminator

    Does anyone know if a C++03 implementations of std::string where c_str() isn't constant complexity (like it is in C++11)?

    [edit]

    This was an interesting read:...
  2. Re: std::string to std::vector with terminator

    >> I think you could even spare the reserve call
    Agreed.



    const string s = "123abc";
    vector<TCHAR> v;

    //v.reserve(s.length() + 1);
    v.assign(s.c_str(), s.c_str() +...
  3. Re: std::string to std::vector with terminator

    I'm partial to reserve + assign + c_str:


    const string s = "123abc";
    vector<TCHAR> v;

    v.reserve(s.length() + 1);
    v.assign(s.c_str(), s.c_str() + s.length() + 1);Assuming that...
  4. Re: std::string to std::vector with terminator

    >> Not an issue in this case, the unicode build is set up to use a std::stringw so it remains a straightforward copy.
    I'm confused. So the source of the copy is always "std::string", and the ANSI...
Results 1 to 4 of 4





Click Here to Expand Forum to Full Width

Featured