473,804 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(imag e);

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<doub le>(image) or deallocate<>(im age), it compiles
without errors.
Why is this necessary? Or is it this only a problem with MSVC6?

Jul 22 '05 #1
1 1438
Jef Driesen wrote:
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(imag e);

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<doub le>(image) or deallocate<>(im age), 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
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
17881
by: Nitin Bhardwaj | last post by:
Thanx in advance for the response... I wanna enquire ( as it is asked many a times in Interviews that i face as an Engg PostGraduate ) about the overloading capability of the C++ Language. Why can't the = (assignment) operator be overloaded as a friend function ? I work in VS 6.0 ( Win2000 ) as when i referred the MSDN documen'n it said the following :
7
3648
by: Victor Hannak | last post by:
I have the following 2 files as part of my project: GenFuncs.h ------------ #ifndef GenFuncsH #define GenFuncsH #include <iostream.h> #include <strstream.h> using namespace std;
4
2100
by: user | last post by:
I am trying to port a simple vector/matrix class library to mingw (v3.4.2). I have used this library with no problem on MSVC++ v6 for a number of years. My difficulty is that it does not compile under g++! Two issues: Firstly, if I define x to be a CColumnVector, y to be a CRowVector and M to be a CMatrix (of the right size!) then: M = x * y;
44
2442
by: bahadir.balban | last post by:
Hi, What's the best way to implement an overloaded function in C? For instance if you want to have generic print function for various structures, my implementation would be with a case statement: void print_structs(void * struct_argument, enum struct_type stype) { switch(stype) { case STRUCT_TYPE_1:
3
2255
by: cybertof | last post by:
Hello, Is it possible in C# to have 2 overloaded functions with - same names - same parameters - different return type values If no, is it possible in another language ?
4
1840
by: Vish | last post by:
Hi all, I am having a build error in one of the overloaded functions in my class. The function takes either a string as a parameter or a type referenced in another dll as a parameter. My class references the dll where the type of the parameter is defined. I am able to create to create my class in a form without any build errors and without any references to the DLL where the other parameter type is defined. The form only uses the...
4
2752
by: chrisstankevitz | last post by:
This code does not compile on gcc 3.4.4. Should it? Thanks for your help, Chris //================ #include <set> int main()
13
2573
by: mike3 | last post by:
Hi. (crossposted because the program is in C++ and some C++-related elements are discussed, hence comp.lang.c++, plus general program design questions are asked, hence comp.programming.) I'm making this bignum package in C++. I'm wondering though on how to handle the errors. Right now most operations routines return error codes if they fail -- but some routines they use inside them, or overloaded operators, will throw exceptions on...
7
4789
by: ma740988 | last post by:
Consider the equation (flight dynamics stuff): Yaw (Degrees) = Azimuth Angle(Radians) * 180 (Degrees) / 3.1415926535897932384626433832795 (Radians) There's a valid reason to use single precision floating point types. The number of decimal digits guaranteed to be correct on my implementation is 6. (i.e numeric_limits < float >::digits10 = 6 ) If I'm reading the IEEE standard, I'd could paraphrase the issue
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.