Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7749787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:07:33+00:00 2026-06-01T11:07:33+00:00

I use the Boost library to implement my application. All the string characters in

  • 0

I use the Boost library to implement my application. All the string characters in the data model of my application are wide chars (wchar_t type). But in the boost library, some classes only hand the narrow char (char type), i.e. “address boost::asio::ip::address::from_string(const char* str)“. So I need to make the conversion between std::string and std::wstring when call the boost functions.

  1. Is there performance issue due to the string conversions?
  2. In there the converter in Boost, which makes the conversion between std::wstring and std::string with good performance?

UPDATE

Regarding the converter function. I find the code below works.

std::wstring wstr(L"Hello World");
const std::string nstr( wstr.begin(),  wstr.end());
const std::wstring wstr2(nstr.begin(), nstr.end());
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:07:34+00:00Added an answer on June 1, 2026 at 11:07 am

    Add the research conclusion myself.

    Regarding the performance overhead of the string conversion. I debugged into the functions above. The conversion is implemented by the C-cast char by char. The time complexity is O(L), L is the length of the string. In my application, the strings required to be converted are not very long. So I don’t think there is any obviously performance latency due to the conversions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the boost library in my code but get the following
I tried to use boost library in 64 bit mode of VS2008 but I'm
boost:: asio provides an example of how to use the library to implement asynchronous
which boost library should I use to implement RTTI in my project?? Is it
I was wondering if there was a way to use the boost library in
I am trying to use the boost generic image library to convert CYMK images
I am writing a Graph-class using boost-graph-library. I use custom vertex and edge properties
Why does nobody seem to use tuples in C++, either the Boost Tuple Library
I use boost::shared_ptr in my application in C++. The memory problem is really serious,
I'm trying to use boost::signal to implement a callback mechanism, and I'm getting a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.