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 6833539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:59:27+00:00 2026-05-26T22:59:27+00:00

I get the following errors which is a slight improvement after taking weeks (very

  • 0

I get the following errors which is a slight improvement after taking weeks (very part-time) getting the errors out of my code:

1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\sstream(451) : error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ios(151) : see declaration of 'std::basic_ios<_Elem,_Traits>::basic_ios'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        This diagnostic occurred in the compiler generated function 'std::basic_ostringstream<_Elem,_Traits,_Alloc>::basic_ostringstream(const std::basic_ostringstream<_Elem,_Traits,_Alloc> &)'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Alloc=std::allocator<char>
1>        ]

I am migrating from the CLI to std:: classes which I have even less experience with.

I think where it is saying “This diagnostic occurred in the compiler generated function” the function being referred to is my std::ostringstream os;.

I use os like as follows:

        os << "Level: " << levelName << ", contains unexpected header at line " << (numMatched + 1)
            << "\nExpected:\n" << longStringHeader;
        addToErrorSTDstring(os);

because std::string concatenation took a line up with each addition.

The only way I use ostringstream is

bool LevelParser::addToErrorSTDstring(std::ostringstream os){

which I believe ildjarn just perspicaciously identified as the problem for me.

  • 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-05-26T22:59:27+00:00Added an answer on May 26, 2026 at 10:59 pm

    The error indicates that you’re trying to copy an instance of std::ostringstream, but all standard streams are non-copyable objects (in C++11 they are, however, movable).

    That’s the root of the problem, but without seeing your actual code we can’t give you concrete suggestions on how to fix it.


    EDIT (in response to OP’s edit):

    addToErrorSTDstring undoubtedly takes a std::ostringstream by value, i.e. has a signature like:

    T addToErrorSTDstring(std::ostringstream os);
    

    Instead, you need to pass it by reference, i.e. change the signature to something like:

    T addToErrorSTDstring(std::ostringstream const& os);
    

    or:

    T addToErrorSTDstring(std::ostringstream& os);
    

    (depending on how you use it).

    If you’re new to C++, then you need to stop what you’re working on and brush up on language fundamentals such as references and const-correctness.

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

Sidebar

Related Questions

I have the following code, for which I get the error: Warning : mysqli_stmt::bind_result()
I tried the following code. Although I don't get any errors, it did not
I'm trying to compile code in g++ and I get the following errors: In
Can anyone explain why I get the following errors when compiling the code shown
I get the following errors with my code. cannot convert parameter 1 from 'std::string'
When I try to serialize class with protected members, I get the following errors:
For the following header I get the same two errors on all my sitemaps.
I want to do the following,but I get errors: procedure JumpToCodeCave(CurrentLocation:DWORD;Destination:Pointer;out_JmpBack:Pointer); var calc:DWORD; jmppatch:Array[0..3]
I get the following errors when I try to compile any Android RenderScript sample
I have the following code with the following errors and I am not sure

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.