 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jef Driesen Guest
|
Posted: Thu Jan 29, 2004 3:24 pm Post subject: Compile error with overloaded functions |
|
|
I have 4 overloaded functions 'deallocate':
template <typename T> void deallocate(T* mem);
template <typename T> void deallocate(T** mem);
template <typename T> void deallocate(T*** mem);
template <typename T> void deallocate(T**** mem);
When i try to compile code like:
double ***image= allocate<double>(bands, rows, columns);
deallocate(image);
I get the following errors:
error C2667: 'deallocate' : none of 3 overload have a best conversion
error C2668: 'deallocate' : ambiguous call to overloaded function
When I write deallocate<double>(image) or deallocate<>(image), it compiles
without errors.
Why is this necessary? Or is it this only a problem with MSVC6?
|
|
| Back to top |
|
 |
Michael Mellor Guest
|
Posted: Thu Jan 29, 2004 3:29 pm Post subject: Re: Compile error with overloaded functions |
|
|
Jef Driesen wrote:
| Quote: | I have 4 overloaded functions 'deallocate':
template <typename T> void deallocate(T* mem);
template <typename T> void deallocate(T** mem);
template <typename T> void deallocate(T*** mem);
template <typename T> void deallocate(T**** mem);
When i try to compile code like:
double ***image= allocate<double>(bands, rows, columns);
deallocate(image);
I get the following errors:
error C2667: 'deallocate' : none of 3 overload have a best conversion
error C2668: 'deallocate' : ambiguous call to overloaded function
When I write deallocate<double>(image) or deallocate<>(image), it compiles
without errors.
Why is this necessary? Or is it this only a problem with MSVC6?
It is a problem with MSVC 6. |
Michael Mellor
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|