Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: PASSTHROUGH printing using Escape Pin
basementman30-Jan-04 9:56
basementman30-Jan-04 9:56 
GeneralRe: PASSTHROUGH printing using Escape Pin
Jimmy M Joy30-Jan-04 17:29
Jimmy M Joy30-Jan-04 17:29 
GeneralRe: PASSTHROUGH printing using Escape Pin
basementman2-Feb-04 4:13
basementman2-Feb-04 4:13 
Generaltemplate class friend of another template class Pin
Jerome Conus30-Jan-04 2:36
Jerome Conus30-Jan-04 2:36 
GeneralRe: template class friend of another template class Pin
toxcct30-Jan-04 3:11
toxcct30-Jan-04 3:11 
GeneralRight click menu and sending messages Pin
lobanovski30-Jan-04 2:09
lobanovski30-Jan-04 2:09 
GeneralRe: Right click menu and sending messages Pin
Michael P Butler30-Jan-04 3:39
Michael P Butler30-Jan-04 3:39 
Generaltemplate magic - generic callbacks + return values Pin
peterchen30-Jan-04 0:16
peterchen30-Jan-04 0:16 
I'm trying to design some generic callbacks, which works well enough (using similar techniques to Andrescu's ScopeGuards[^]), except for the return value of the callback function.

for void, it#s simple:
struct CCallback { virtual void Call() = 0; }

template <class T>
struct CCallbackFunc_0 : public CCallback
{
   T func;
   CCallbackFunc_0(T func_) : func(func_) {}
   void Call() { func(); }
};

template <class T>
CCallback * CreateCallback(T func_)
{
  return new CCallbackFunc_0<T>(func_);
}


Now I figure I could have two separate branches, one templatized over the return type, but this makes a lot of code, and breaks the nice syntax for using CreateCallback.

Any ideas? Suggestions? Other approaches?



Flirt harder, I'm a coder.

mlog || Agile Programming | doxygen

GeneralRe: template magic - generic callbacks + return values Pin
Ryan Binns30-Jan-04 2:23
Ryan Binns30-Jan-04 2:23 
GeneralRe: template magic - generic callbacks + return values Pin
peterchen30-Jan-04 3:00
peterchen30-Jan-04 3:00 
GeneralCommunicating with Proxy Pin
sinuommen29-Jan-04 22:32
sinuommen29-Jan-04 22:32 
GeneralRe: Communicating with Proxy Pin
Prakash Nadar29-Jan-04 23:11
Prakash Nadar29-Jan-04 23:11 
Generala RSS reader Pin
Jerome Conus29-Jan-04 20:46
Jerome Conus29-Jan-04 20:46 
GeneralRe: a RSS reader Pin
Taka Muraoka29-Jan-04 21:43
Taka Muraoka29-Jan-04 21:43 
QuestionURGENT : Black Image??? Pin
chio110229-Jan-04 20:16
chio110229-Jan-04 20:16 
Generali want to get the handle of Dialog , that i created after clicking on a button Pin
Anonymous29-Jan-04 20:10
Anonymous29-Jan-04 20:10 
GeneralRe: i want to get the handle of Dialog , that i created after clicking on a button Pin
SJolly29-Jan-04 22:03
SJolly29-Jan-04 22:03 
GeneralRe: i want to get the handle of Dialog , that i created after clicking on a button Pin
John M. Drescher30-Jan-04 4:51
John M. Drescher30-Jan-04 4:51 
GeneraliCON OVERLAY Pin
mjvalan29-Jan-04 19:44
mjvalan29-Jan-04 19:44 
Generalweb browser plugins Pin
Abhi Lahare29-Jan-04 19:29
Abhi Lahare29-Jan-04 19:29 
GeneralRe: web browser plugins Pin
Prakash Nadar29-Jan-04 22:22
Prakash Nadar29-Jan-04 22:22 
GeneralRe: IE web browser plugins Pin
Abhi Lahare29-Jan-04 22:44
Abhi Lahare29-Jan-04 22:44 
GeneralRe: IE web browser plugins Pin
Prakash Nadar29-Jan-04 23:09
Prakash Nadar29-Jan-04 23:09 
Questionhow to convert text into image using VC++6.0 Pin
emmatty29-Jan-04 18:39
emmatty29-Jan-04 18:39 
AnswerRe: how to convert text into image using VC++6.0 Pin
basementman30-Jan-04 10:04
basementman30-Jan-04 10:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.