B
Bill Oliver
Help! I am writing an image processing package. For
one constructor, I allow creating an image from a
map of points and color values. The points are
of a "position" class and the colors are just a
vector. It starts thusly:
template <class T>
image<T>::image(map<position<int> , vector<T> >& in_map){
cerr<< "***** ***** ***** ***** ***** *****\n";
cerr<< "making image from map \n";
cerr<< "***** ***** ***** ***** ***** *****\n";
// make an iterator into the input map
map< position<int>, vector<T> >::iterator mapit;
mapit = in_map.begin();
.... do stuff with the iterator
}
Oddly, this compiled just fine a month or so ago before I
upgraded my OS from Mandriva 2006 to Mandriva 2007.
Now, however, I get the error:
constructors.cpp: In constructor 'image<T>::image(std::map<position<int>, std::vector<T, std::allocator<_CharT> >, std::less<position<int> >, std::allocator<std:
air<const position<int>, std::vector<T, std::allocator<_CharT> > > > >&)':
constructors.cpp:127: error: expected `;' before 'mapit'
constructors.cpp:128: error: 'mapit' was not declared in this scope
Even more oddly, to me, if I add another iterator, I don't get
an additional error:
template <class T>
image<T>::image(map<position<int> , vector<T> >& in_map){
cerr<< "***** ***** ***** ***** ***** *****\n";
cerr<< "making image from map \n";
cerr<< "***** ***** ***** ***** ***** *****\n";
// make an iterator into the input map
map<char,int>::iterator testiterator;
map< position<int>, vector<T> >::iterator mapit;
mapit = in_map.begin();
.... do stuff with the iterator
}
gives the same error -- it doesn't choke on testiterator.
Configuration:
HP Pavilion zd8000 Pentium4 laptop
Mandriva 2007 linux
gcc version 4.1.1 20060724 (prerelease) (4.1.1-3mdk)
Any pointers would be appreciated!!
Thanks,
billo
one constructor, I allow creating an image from a
map of points and color values. The points are
of a "position" class and the colors are just a
vector. It starts thusly:
template <class T>
image<T>::image(map<position<int> , vector<T> >& in_map){
cerr<< "***** ***** ***** ***** ***** *****\n";
cerr<< "making image from map \n";
cerr<< "***** ***** ***** ***** ***** *****\n";
// make an iterator into the input map
map< position<int>, vector<T> >::iterator mapit;
mapit = in_map.begin();
.... do stuff with the iterator
}
Oddly, this compiled just fine a month or so ago before I
upgraded my OS from Mandriva 2006 to Mandriva 2007.
Now, however, I get the error:
constructors.cpp: In constructor 'image<T>::image(std::map<position<int>, std::vector<T, std::allocator<_CharT> >, std::less<position<int> >, std::allocator<std:
constructors.cpp:127: error: expected `;' before 'mapit'
constructors.cpp:128: error: 'mapit' was not declared in this scope
Even more oddly, to me, if I add another iterator, I don't get
an additional error:
template <class T>
image<T>::image(map<position<int> , vector<T> >& in_map){
cerr<< "***** ***** ***** ***** ***** *****\n";
cerr<< "making image from map \n";
cerr<< "***** ***** ***** ***** ***** *****\n";
// make an iterator into the input map
map<char,int>::iterator testiterator;
map< position<int>, vector<T> >::iterator mapit;
mapit = in_map.begin();
.... do stuff with the iterator
}
gives the same error -- it doesn't choke on testiterator.
Configuration:
HP Pavilion zd8000 Pentium4 laptop
Mandriva 2007 linux
gcc version 4.1.1 20060724 (prerelease) (4.1.1-3mdk)
Any pointers would be appreciated!!
Thanks,
billo