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

  • SEARCH
  • Home
  • 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 8615653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:25:55+00:00 2026-06-12T05:25:55+00:00

A couple questions about semantics and performance: x = 0; While (x < 10)

  • 0

A couple questions about semantics and performance:

x = 0;
While (x < 10) {
  std::cout << "Some text here to send to cout";
  ++x;
}

Im using gcc 4.7, Should the text to stream be wrapped inside of a std::move?

Like this:

   x = 0;
    While (x < 10) {
      std::cout << std::move("Some text here to send to cout");
      ++x;
    }

And while I am asking, is it better in cases like this to just make the string static like:

x = 0;
While (x < 10) {
  static const char* s = "Some text here to send to cout";
  std::cout << s;
  ++x;
}
  • 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-12T05:25:57+00:00Added an answer on June 12, 2026 at 5:25 am

    Moving a string literal won’t really do you much good: It will yield a pointer in any case and this pointer will be passed by value. With respect to making the string literal static, I would expect that it make no difference at all.

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

Sidebar

Related Questions

I have a couple of questions about using databases with Jquery Mobile. When you
I came across couple of questions about OCL expressions. After reading some university slides
I have a couple questions about how to use C++ sets (std::set) Is there
There are many questions about events in interfaces. Here are a couple: Raising events
I've found a couple questions about this on here, but can't find a solution.
I've looked at a couple of questions about using current_user for an Observer and
A couple questions about Range.NumberFormat here--hopefully someone has ready answers they can provide, as
I have a couple questions about SSL. What happens if someone tampers or changes
I have a couple questions about exceptions. 1) when you hit a catch block,
I have a couple questions about submitting blue-tooth enabled apps on the iPhone. I

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.