Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Disabling a function definition

Reply
Thread Tools

Disabling a function definition

 
 
er
Guest
Posts: n/a
 
      02-09-2010
Hi All,
Here's an dilemma:

I used to have some code like this:

template<int i>
void f(){};

but now I found out how to do away with the template parameter:

void f(){};

However, I don't want to rewrite the old code I have that depends on
the first definition, while being able to use the new definition in
the new code. I don't think I can have it both ways, but perhaps
someone else has thought of this before me.


 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      02-09-2010
er wrote:
> Here's an dilemma:
>
> I used to have some code like this:
>
> template<int i>
> void f(){};
>
> but now I found out how to do away with the template parameter:
>
> void f(){};
>
> However, I don't want to rewrite the old code I have that depends on
> the first definition, while being able to use the new definition in
> the new code. I don't think I can have it both ways, but perhaps
> someone else has thought of this before me.


Have you tried just having them both? If yes, what happened? If not,
why not?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
 
Reply With Quote
 
 
 
 
er
Guest
Posts: n/a
 
      02-10-2010

> Have you tried just having them both? *If yes, what happened? *If not,
> why not?



Good thing I stopped by, and thank you!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time template list definition / Run-time variable type definition Pierre Yves C++ 2 01-10-2008 02:52 PM
Automagic determination of definition based on definition location. Jon Slaughter C++ 4 10-26-2005 05:00 PM
can a class definition inside another class's definition Jianli Shen C++ 1 03-13-2005 06:02 PM
help?: incomplete definition with complete definition in scope Ark C Programming 1 08-07-2004 04:21 PM
Function definition into main() function. CViniciusM C Programming 2 02-27-2004 03:39 PM



Advertisments