Boost logo

Boost Users :

From: Sean Farrow (sean.farrow_at_[hidden])
Date: 2008-07-07 04:49:58


Hi:
I carn't use that approach, the string is already constructed.
The string is part of a structure. I could contruct a temporary string,
and then assign the temporary string to the string in the structure,
will this reset the length of the string in the structure?
Sean.

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Chris
Jefferson
Sent: 07 July 2008 09:44
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Converting an std::vector to std::wstring

2008/7/6 Sean Farrow <sean.farrow_at_[hidden]>:
> Hi:
> What is the best way (in terms of efficiency) to convert an
> std::vector of wchar_t to std::wstring.
> I can think of a oupple of aproaches:
> 1. using std::copy.
> 2. using boost::lexical_cast.
> 3 using boost::foreach
> 4. Usin he boost::serialization library.

I suspect 5. None of the above.

The quickest and most efficent way to switch between two containers
which contain the same type is:

new_container container(old_container.begin(), old_container.end() )

so in this case:

wstring my_string(v.begin(), e.end());

> The std::wstring doesn't ned to be output to a file.
> Any advice apreciated.
> Sean.
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 3244 (20080705) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
 

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 3245 (20080707) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 3245 (20080707) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net