A
Alex Vinokur
Is it possible to use vector<ostringstream> ?
Here is what I have got.
===========================================
Windows 2000
CYGWIN_NT-5.0 1.3.22(0.78/3/2)
GNU gcc version 3.2 20020927 (prerelease)
===========================================
// File t.cpp
--------- C++ code : BEGIN ---------
#include <vector>
#include <sstream>
#include <iostream>
using namespace std;
int main ()
{
vector<ostringstream> oss;
oss.push_back (ostringstream()); // Line#10
oss.front() << "ABCD" << endl;
cout << oss.front().str();
return 0;
}
--------- C++ code : END -----------
--------- Compilation : BEGIN ---------
$ g++ t.cpp
/usr/include/c++/3.2/bits/ios_base.h: In copy constructor `std::basic_ios<char,
std::char_traits<char> >::basic_ios(const std::basic_ios<char,
std::char_traits<char> >&)':
/usr/include/c++/3.2/bits/stl_construct.h:78: instantiated from `void std::_Construct(_T1*, const _T2&) [with _T1 =
std:stringstream, _T2 = std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >]'
/usr/include/c++/3.2/bits/stl_vector.h:492: instantiated from `void std::vector<_Tp, _Alloc>:ush_back(const _Tp&) [with _Tp =
std:stringstream, _Alloc = std::allocator<std:stringstream>]'
t.cpp:10: instantiated from here
/usr/include/c++/3.2/bits/ios_base.h:421: `std::ios_base::ios_base(const
std::ios_base&)' is private
/usr/include/c++/3.2/bits/stl_construct.h:78: within this context
/usr/include/c++/3.2/streambuf: In copy constructor `std::basic_stringbuf<char,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&)
[with _CharT = char, _Traits = std::char_traits<char>]' is private
/usr/include/c++/3.2/bits/stl_construct.h:78: within this context
/usr/include/c++/3.2/bits/ios_base.h: In member function `std::basic_ios<char,
_Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = std:stringstream,
_Alloc = std::allocator<std:stringstream>]'
/usr/include/c++/3.2/bits/stl_vector.h:496: instantiated from `void std::vector<_Tp, _Alloc>:ush_back(const _Tp&) [with _Tp =
std:stringstream, _Alloc = std::allocator<std:stringstream>]'
t.cpp:10: instantiated from here
/usr/include/c++/3.2/bits/ios_base.h:424: `std::ios_base&
std::ios_base:perator=(const std::ios_base&)' is private
/usr/include/c++/3.2/bits/stl_vector.h:893: within this context
/usr/include/c++/3.2/streambuf: In member function `std::basic_stringbuf<char,
std::char_traits<char>, std::allocator<char> >& std::basic_stringbuf<char,
std::basic_streambuf<_CharT, _Traits>:perator=(const
std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits =
std::char_traits<char>]' is private
/usr/include/c++/3.2/bits/stl_vector.h:893: within this context
--------- Compilation : END -----------
--
==========================================
Alex Vinokur
mailto:[email protected]
http://www.simtel.net/pub/oth/19088.html
http://sourceforge.net/users/alexvn
==========================================
Here is what I have got.
===========================================
Windows 2000
CYGWIN_NT-5.0 1.3.22(0.78/3/2)
GNU gcc version 3.2 20020927 (prerelease)
===========================================
// File t.cpp
--------- C++ code : BEGIN ---------
#include <vector>
#include <sstream>
#include <iostream>
using namespace std;
int main ()
{
vector<ostringstream> oss;
oss.push_back (ostringstream()); // Line#10
oss.front() << "ABCD" << endl;
cout << oss.front().str();
return 0;
}
--------- C++ code : END -----------
--------- Compilation : BEGIN ---------
$ g++ t.cpp
/usr/include/c++/3.2/bits/ios_base.h: In copy constructor `std::basic_ios<char,
std::char_traits<char> >::basic_ios(const std::basic_ios<char,
std::char_traits<char> >&)':
/usr/include/c++/3.2/bits/stl_construct.h:78: instantiated from `void std::_Construct(_T1*, const _T2&) [with _T1 =
std:stringstream, _T2 = std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >]'
/usr/include/c++/3.2/bits/stl_vector.h:492: instantiated from `void std::vector<_Tp, _Alloc>:ush_back(const _Tp&) [with _Tp =
std:stringstream, _Alloc = std::allocator<std:stringstream>]'
t.cpp:10: instantiated from here
/usr/include/c++/3.2/bits/ios_base.h:421: `std::ios_base::ios_base(const
std::ios_base&)' is private
/usr/include/c++/3.2/bits/stl_construct.h:78: within this context
/usr/include/c++/3.2/streambuf: In copy constructor `std::basic_stringbuf<char,
/usr/include/c++/3.2/streambuf:486: `std::basic_streambuf<_CharT,std::allocator<char> >::basic_stringbuf(const said:&)':
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&)
[with _CharT = char, _Traits = std::char_traits<char>]' is private
/usr/include/c++/3.2/bits/stl_construct.h:78: within this context
/usr/include/c++/3.2/bits/ios_base.h: In member function `std::basic_ios<char,
/usr/include/c++/3.2/bits/stl_vector.h:893: instantiated from `void std::vector<_Tp,std::char_traits said::perator=(const std::basic_ios<char, std::char_traits<char> >&)':
_Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = std:stringstream,
_Alloc = std::allocator<std:stringstream>]'
/usr/include/c++/3.2/bits/stl_vector.h:496: instantiated from `void std::vector<_Tp, _Alloc>:ush_back(const _Tp&) [with _Tp =
std:stringstream, _Alloc = std::allocator<std:stringstream>]'
t.cpp:10: instantiated from here
/usr/include/c++/3.2/bits/ios_base.h:424: `std::ios_base&
std::ios_base:perator=(const std::ios_base&)' is private
/usr/include/c++/3.2/bits/stl_vector.h:893: within this context
/usr/include/c++/3.2/streambuf: In member function `std::basic_stringbuf<char,
std::char_traits<char>, std::allocator<char> >& std::basic_stringbuf<char,
/usr/include/c++/3.2/streambuf:489: `std::basic_streambuf<_CharT, _Traits>&std::allocator<char> >::operator=(const said:&)':
std::basic_streambuf<_CharT, _Traits>:perator=(const
std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits =
std::char_traits<char>]' is private
/usr/include/c++/3.2/bits/stl_vector.h:893: within this context
--------- Compilation : END -----------
--
==========================================
Alex Vinokur
mailto:[email protected]
http://www.simtel.net/pub/oth/19088.html
http://sourceforge.net/users/alexvn
==========================================