delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/22/12:15:33

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "Sean Chen" <sean_h_chen AT msn DOT com>
Newsgroups: comp.os.msdos.djgpp,gnu.g++.help
Subject: Re: gpp 3.0.4 & stl_iterator.h
Date: Mon, 22 Apr 2002 12:14:00 -0400
Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov)
Lines: 313
Message-ID: <aa1d66$23t$1@skates.gsfc.nasa.gov>
References: <a9ucus$62ivj$1 AT ID-79865 DOT news DOT dfncis DOT de> <aa0jtb$6ot7t$1 AT ID-79865 DOT news DOT dfncis DOT de>
NNTP-Posting-Host: lepkalb-lena.gsfc.nasa.gov
X-Trace: skates.gsfc.nasa.gov 1019492358 2173 128.183.22.139 (22 Apr 2002 16:19:18 GMT)
X-Complaints-To: usenet AT news DOT gsfc DOT nasa DOT gov
NNTP-Posting-Date: 22 Apr 2002 16:19:18 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Alex Vinokur" <alexvn AT bigfoot DOT com> wrote in message
news:aa0jtb$6ot7t$1 AT ID-79865 DOT news DOT dfncis DOT de...
>
> "Alex Vinokur" <alexvn AT bigfoot DOT com> wrote in message
news:a9ucus$62ivj$1 AT ID-79865 DOT news DOT dfncis DOT de...
> | =========================================================
> | GNU CPP version 3.0.4 (cpplib) (80386, BSD syntax)
> | GNU C++ version 3.0.4 (djgpp) compiled by GNU C version 3.0.4.
> | Configured with: ../configure
i586-pc-msdosdjgpp --prefix=/dev/env/DJDIR --disable-nls
> | Thread model: single
> |
> | Windows-2000
> | =========================================================
> |
> |
> | Here is compilation results.
> |
> | What may be wrong?
> |
>
> [snip]
>
>
> ###### C++ code : Source file : BEGIN ######
> // File x1.cpp
>
>
> #include <strstream>
> #include <string>
> #include <vector>
> using namespace std;
>
> #define CODE  unsigned int
>
>
> // ------------------------------
> // ------------------------------
> template <typename T1>
> void   func1 (const vector<T1>& vector_i, const string& delimiter_i = " ")
> {
> strstream               tmp_strstream;
> ostream_iterator<T1>    out (tmp_strstream, delimiter_i.c_str ());
                           ^^^^



If T1 is a vector<CODE> you should do get  the error messages
since there isn't an implemetation (at least in gcc 3.0.4 I think, is it?)
for a vector, e.g., "vec" such that the ostream operator "<<", e.g., "cout
<< vec << endl;" works
you will need to implement it by yourself.






>
>   copy (vector_i.begin (), vector_i.end (), out);
>
> }
>
>
>
> // ------------------------------
> // ------------------------------
> template <typename T1, typename T2, unsigned int T3>
> class AAA
> {
>   public :
>     AAA () {}
>     ~AAA () {}
>     void doit () const;
>
> };
>
>
>
>
> // ------------------------------
> template <typename T1, typename T2, unsigned int T3>
> void AAA<T1, T2, T3>::doit () const
>
> {
> vector<vector<CODE> >   v1;
>
>   func1(v1);
> }
>
>
>
> // ------------------------------
> // ------------------------------
> int main ()
> {
> AAA<char, int, 5> aaa_01;
>
>   aaa_01.doit ();
>   return 0;
>
> }
>
>
>
> ###### C++ code : Source file : END ########
>
>
>
>
> ###### Compilation : BEGIN ######
>
> %gpp -W -Wall x1.cpp
>
> c:/djgpp/lang/cxx-v3/bits/stl_iterator.h: In member function
>    `std::ostream_iterator<_Tp, char, std::char_traits<char> >&
>    std::ostream_iterator<_Tp, _CharT, _Traits>::operator=(const _Tp&)
[with _Tp
>    = std::vector<unsigned int, std::allocator<unsigned int> >, _CharT =
char,
>    _Traits = std::char_traits<char>]':
> c:/djgpp/lang/cxx-v3/bits/stlalgobase.h:182:   instantiated from
`_OutputIter std::__copy(_RandomAccessIter, _RandomAccessIter,
> _OutputIter, std::random_access_iterator_tag, _Distance*) [with
_RandomAccessIter = const std::vector<unsigned int,
> std::allocator<unsigned int> >*, _OutputIter =
std::ostream_iterator<std::vector<unsigned int, std::allocator<unsigned int>
>, char,
> std::char_traits<char> >, _Distance = ptrdiff_t]'
> c:/djgpp/lang/cxx-v3/bits/stlalgobase.h:202:   instantiated from
`_OutputIter std::__copy_aux2(_InputIter, _InputIter, _OutputIter,
> _Bool<false>) [with _InputIter = const std::vector<unsigned int,
std::allocator<unsigned int> >*, _OutputIter =
> std::ostream_iterator<std::vector<unsigned int, std::allocator<unsigned
int> >, char, std::char_traits<char> >]'
> c:/djgpp/lang/cxx-v3/bits/stlalgobase.h:237:   instantiated from
`_OutputIter std::__copy_aux(_InputIter, _InputIter, _OutputIter,
> _Tp*) [with _InputIter = const std::vector<unsigned int,
std::allocator<unsigned int> >*, _OutputIter =
> std::ostream_iterator<std::vector<unsigned int, std::allocator<unsigned
int> >, char, std::char_traits<char> >, _Tp =
> std::vector<unsigned int, std::allocator<unsigned int> >]'
> c:/djgpp/lang/cxx-v3/bits/stlalgobase.h:252:   instantiated from
`_OutputIter std::__copy_ni2(_InputIter, _InputIter, _OutputIter,
> _Bool<false>) [with _InputIter = const std::vector<unsigned int,
std::allocator<unsigned int> >*, _OutputIter =
> std::ostream_iterator<std::vector<unsigned int, std::allocator<unsigned
int> >, char, std::char_traits<char> >]'
> c:/djgpp/lang/cxx-v3/bits/stlalgobase.h:260:   instantiated from
`_OutputIter std::__copy_ni1(_InputIter, _InputIter, _OutputIter,
> _Bool<true>) [with _InputIter = std::__normal_iterator<const
std::vector<unsigned int, std::allocator<unsigned int> >*,
> std::vector<std::vector<unsigned int, std::allocator<unsigned int> >,
std::allocator<std::vector<unsigned int,
> std::allocator<unsigned int> > > > >, _OutputIter =
std::ostream_iterator<std::vector<unsigned int, std::allocator<unsigned int>
>,
> char, std::char_traits<char> >]'
> c:/djgpp/lang/cxx-v3/bits/stlalgobase.h:281:   instantiated from
`_OutputIter std::copy(_InputIter, _InputIter, _OutputIter) [with
> _InputIter = std::__normal_iterator<const std::vector<unsigned int,
std::allocator<unsigned int> >*,
> std::vector<std::vector<unsigned int, std::allocator<unsigned int> >,
std::allocator<std::vector<unsigned int,
> std::allocator<unsigned int> > > > >, _OutputIter =
std::ostream_iterator<std::vector<unsigned int, std::allocator<unsigned int>
>,
> char, std::char_traits<char> >]'
> x1.Cpp:18:   instantiated from `void func1(const std::vector<T1,
std::allocator<_CharT> >&, const std::string&) [with T1 =
> std::vector<unsigned int, std::allocator<unsigned int> >]'
> x1.Cpp:46:   instantiated from `void AAA<T1, T2, T3>::doit() const [with
T1 = char, T2 = int, unsigned int T3 = 5]'
> x1.Cpp:57:   instantiated from here
> c:/djgpp/lang/cxx-v3/bits/stl_iterator.h:426: no match for
>    `std::basic_ostream<char, std::char_traits<char> >& << const
>    std::vector<unsigned int, std::allocator<unsigned int> >&' operator
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:50: candidates are:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(std::basic_ostream<_CharT,
>    _Traits>&(*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT =
char,
>    _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:72:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(std::basic_ios<_CharT,
>    _Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char,
_Traits
>    = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:94:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(std::ios_base&(*)(std::ios_base&)) [with _CharT =
char,
>    _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:140:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(long int) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:177:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:115:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(bool) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:99:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(short int) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:110:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:114:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(int) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:125:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:203:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(long long int) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:241:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(long long unsigned int) [with _CharT = char,
_Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:267:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(double) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:140:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(float) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:292:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(long double) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:317:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(const void*) [with _CharT = char, _Traits =
>    std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:342:
>    std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
>    _Traits>::operator<<(std::basic_streambuf<_CharT, _Traits>*) [with
_CharT =
>    char, _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:215:
>    std::basic_ostream<_CharT, _Traits>&
>    std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with
_CharT =
>    char, _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:575:
>    std::basic_ostream<char, _Traits>&
std::operator<<(std::basic_ostream<char,
>    _Traits>&, char) [with _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:226:
>    std::basic_ostream<char, _Traits>&
std::operator<<(std::basic_ostream<char,
>    _Traits>&, signed char) [with _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:231:
>    std::basic_ostream<char, _Traits>&
std::operator<<(std::basic_ostream<char,
>    _Traits>&, unsigned char) [with _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:643:
>    std::basic_ostream<_CharT, _Traits>&
>    std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*)
[with
>    _CharT = char, _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/ostream.tcc:689:
>    std::basic_ostream<char, _Traits>&
std::operator<<(std::basic_ostream<char,
>    _Traits>&, const char*) [with _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:250:
>    std::basic_ostream<char, _Traits>&
std::operator<<(std::basic_ostream<char,
>    _Traits>&, const signed char*) [with _Traits = std::char_traits<char>]
> c:/djgpp/lang/cxx-v3/bits/std_ostream.h:255:
>    std::basic_ostream<char, _Traits>&
std::operator<<(std::basic_ostream<char,
>    _Traits>&, const unsigned char*) [with _Traits =
std::char_traits<char>]
>
>
> ###### Compilation : END ########
>
>
> | Thanks in advance.
> |
> |
>
>
> --
> ====================
>   Alex Vinokur
>     http://up.to/alexvn
>     http://go.to/alexv_math
>     mailto:alexvn AT bigfoot DOT com
>     mailto:alexvn AT go DOT to
>   ====================
>
>
>
>
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019