Compilation error ostringstream

M

Michael

Hello,

I can't use STL class 'ostringsstream' in an VC++.net project, because
compilation produces the following error:

Microsoft Visual Studio .NET 2003\Vc7\include\ostream(243): error
C2039: 'failed': no element of
'std::blush:streambuf_iterator<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]




Here is my source code:

#include "stdafx.h"
#include <sstream>

int _tmain(int argc, _TCHAR* argv[])
{
std::blush:stringstream os;
int x = 1;
os << x;

return 0;
}


Is anyone knowing what's going wrong ?

thanks in advance

Michael
 
D

David Lowndes

I can't use STL class 'ostringsstream' in an VC++.net project, because
compilation produces the following error:

Microsoft Visual Studio .NET 2003\Vc7\include\ostream(243): error
C2039: 'failed': no element of
'std::blush:streambuf_iterator<_Elem,_Traits>'

Michael,

I don't have VC7 readily available to test, but your example builds
fine for me with VC 2005.

Dave
 
P

pvdg42

Michael said:
Hello,

I can't use STL class 'ostringsstream' in an VC++.net project, because
compilation produces the following error:

Microsoft Visual Studio .NET 2003\Vc7\include\ostream(243): error
C2039: 'failed': no element of
'std::blush:streambuf_iterator<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]




Here is my source code:

#include "stdafx.h"
#include <sstream>

int _tmain(int argc, _TCHAR* argv[])
{
std::blush:stringstream os;
int x = 1;
os << x;

return 0;
}


Is anyone knowing what's going wrong ?

thanks in advance

Michael
Your code also builds fine in my Visual Studio .NET 2003 (VC++ 7.1), which
appears to be what you're using.
I'd consider a repair install of Visual Studio.
 
M

Michael

pvdg42 said:
Michael said:
Hello,

I can't use STL class 'ostringsstream' in an VC++.net project, because
compilation produces the following error:

Microsoft Visual Studio .NET 2003\Vc7\include\ostream(243): error
C2039: 'failed': no element of
'std::blush:streambuf_iterator<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]




Here is my source code:

#include "stdafx.h"
#include <sstream>

int _tmain(int argc, _TCHAR* argv[])
{
std::blush:stringstream os;
int x = 1;
os << x;

return 0;
}


Is anyone knowing what's going wrong ?

thanks in advance

Michael
Your code also builds fine in my Visual Studio .NET 2003 (VC++ 7.1), which
appears to be what you're using.
I'd consider a repair install of Visual Studio.

You are right; I changed the file xutility.h unintentionally.
In declaration of the class ostreambuf_iterator the line
bool failed() const _THROW0()
was replaced by
boolfailed() const _THROW0()

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top