Mail Archives: djgpp/2002/08/11/02:01:18
"John Harrison" <jahhaj DOT spam AT spam DOT ntlworld DOT com> wrote in message news:Nz759.1526$id3 DOT 59789 AT newsfep2-win DOT server DOT ntli DOT net...
>
> "Alex Vinokur" <alexvn AT bigfoot DOT com> wrote in message
> news:aj2vjj$178ktl$1 AT ID-79865 DOT news DOT dfncis DOT de...
> > ============
> > Windows 2000
> > DJGPP 2.03
> > gcc/gpp 3.1
> > ============
> >
> >
> > The code below has no problem with gcc/gpp 3.0.4.
> >
> > However it does have a problem with gcc/gpp 3.1.
> >
> > What has been changed concerning istream_iterator and ostream_iterator ?
> >
> > ######### C++ code : BEGIN #########
> > // File t1.cpp
> >
> > #include <string>
> > #include <vector>
> > #include <sstream>
> > #include <iostream>
> > #include <fstream>
> > using namespace std;
> >
>
> You should include the header file <iterator> for istream_iterator and
> ostream_iterator.
>
> john
>
>
>
Thanks to John.
I have a new problem while going over (from gcc-3.0.4) to gcc-3.1.
============
Windows 2000
DJGPP 2.03
gcc/gpp 3.1
============
A code below has no problem with gcc/gpp 3.0.4.
However it does have a problem with gcc/gpp 3.1.
It seems that using template with typedef below causes warnings.
######### C++ code : BEGIN #########
// File ttt5.cpp
#include <vector>
#include <map>
using namespace std;
// =============================
// --------------
class AAA {};
bool operator< (const AAA& ins1, const AAA& ins2)
{
return true;
}
// --------------
template <typename T1>
class BBB {};
//=============================
// --------------
template <typename T1>
void foo1 ()
{
// ----------------------------------------
typedef map<AAA, vector<BBB<int> >, less<AAA> > map1_typename; // No problem with gcc-3.1
typedef map1_typename::value_type map1_value_type;
pair<map1_typename::iterator, bool> pair1_insert;
map1_typename::iterator map1_pos;
// ----------------------------------------
typedef map<AAA, vector<BBB<T1> >, less<AAA> > map2_typename; // There is a problem with gcc-3.1
typedef map2_typename::value_type map2_value_type;
pair<map2_typename::iterator, bool> pair2_insert;
map2_typename::iterator map2_pos;
// ----------------------------------------
} // foo1
// --------------
int main ()
{
return 0;
}
######### C++ code : END ###########
######### Compilation : BEGIN #########
%gpp ttt5.cpp
TTT5.CPP: In function `void foo1()':
TTT5.CPP:31: warning: `typename std::map<AAA, std::vector<BBB<T1>,
std::allocator<BBB<T1> > >, std::less<AAA>, std::allocator<std::pair<const
AAA, std::vector<BBB<T1>, std::allocator<BBB<T1> > > > > >::value_type' is
implicitly a typename
TTT5.CPP:31: warning: implicit typename is deprecated, please see the
documentation for details
TTT5.CPP:32: warning: `typename std::map<AAA, std::vector<BBB<T1>,
std::allocator<BBB<T1> > >, std::less<AAA>, std::allocator<std::pair<const
AAA, std::vector<BBB<T1>, std::allocator<BBB<T1> > > > > >::iterator' is
implicitly a typename
TTT5.CPP:32: warning: implicit typename is deprecated, please see the
documentation for details
TTT5.CPP:33: warning: `typename std::map<AAA, std::vector<BBB<T1>,
std::allocator<BBB<T1> > >, std::less<AAA>, std::allocator<std::pair<const
AAA, std::vector<BBB<T1>, std::allocator<BBB<T1> > > > > >::iterator' is
implicitly a typename
TTT5.CPP:33: warning: implicit typename is deprecated, please see the
documentation for details
######### Compilation : END ###########
====================
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 -