• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
C++ standard libs errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ standard libs errors


  • Subject: C++ standard libs errors
  • From: Krassimir Simeonov <email@hidden>
  • Date: Sun, 7 Feb 2010 14:07:18 -0800

Hi,

When I run the following program on Win and Linux it produces output of
22

#include <iostream>

class MyStreamBuf : public std::streambuf
{
protected:
	int overflow ( int c = EOF )
	{
		std::cout << static_cast<char>(c);
		return c;
	}
};

int main( int argc, char** argv )
{
	std::cout << 2;     // ok
	MyStreamBuf myStreamBuf;
	std::ostream myStream(&myStreamBuf);
	myStream << 2;     // exception
}

When I compile and run it in XCode (3.2.1 - MacOS X 10.6) it throws an exception when I try to call the operator <<(int).

I traced this to the point where myStream._M_num_put is NULL.

Does anyone know how to work around this issue?

Cheers,
k.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: C++ standard libs errors
      • From: Chris Espinosa <email@hidden>
  • Prev by Date: Re: what is this "I"?
  • Next by Date: Re: C++ standard libs errors
  • Previous by thread: Re: what is this "I"?
  • Next by thread: Re: C++ standard libs errors
  • Index(es):
    • Date
    • Thread