Click here to Skip to main content
15,895,884 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Copying and Pasting file of any type Pin
dabs21-Apr-03 4:43
dabs21-Apr-03 4:43 
GeneralQuestion about local variable used as a reference. Pin
George220-Apr-03 22:18
George220-Apr-03 22:18 
GeneralRe: Question about local variable used as a reference. Pin
Joaquín M López Muñoz20-Apr-03 22:36
Joaquín M López Muñoz20-Apr-03 22:36 
GeneralRe: Question about local variable used as a reference. Pin
George220-Apr-03 23:27
George220-Apr-03 23:27 
GeneralURGENT HELP REQUIRED:mad: Pin
Cyberizen20-Apr-03 22:01
Cyberizen20-Apr-03 22:01 
GeneralRe: URGENT HELP REQUIRED:mad: Pin
Joaquín M López Muñoz20-Apr-03 22:39
Joaquín M López Muñoz20-Apr-03 22:39 
QuestionWhere can I find tutorial about interface? Pin
George220-Apr-03 21:56
George220-Apr-03 21:56 
GeneralTemplate overriding of operator [] Pin
Alexandru Savescu20-Apr-03 21:20
Alexandru Savescu20-Apr-03 21:20 
Hello,

I have a class and I want to override its [] operator. So I did like this:
int operator [] (LPCTSTR x)
{
.....
}


Now I want my operator to return long, doubles, strings etc. I don't want to manually write dozen of operators, but handle it with templates:
template <typename T>
T operator [] (LPCTSTR x)
{
  T t;
  ....
  return t;
}


This complies fine. My problem is that I don't know how to call my template operator. I tried:
MyClass m;
m["str"]<int>;
m<int>["str"];
m.operator <int>[] ("str");

but all I got were compiler errors.
Any ideas?
Thanks

Best regards,
Alexandru Savescu

P.S. Interested in art? Visit this!
GeneralRe: Template overriding of operator [] Pin
Joaquín M López Muñoz20-Apr-03 21:51
Joaquín M López Muñoz20-Apr-03 21:51 
GeneralTiming problem in run-time loading DLL Pin
pklim20-Apr-03 20:17
pklim20-Apr-03 20:17 
QuestionCListCtrl: AutoArrage & Ascending Sort? Pin
Bùi Phạm Minh Trí20-Apr-03 16:56
Bùi Phạm Minh Trí20-Apr-03 16:56 
GeneralQuestion about a edit box! Help! Pin
dxhdxh20-Apr-03 14:09
dxhdxh20-Apr-03 14:09 
GeneralRe: Question about a edit box! Help! Pin
Nick Parker20-Apr-03 16:57
protectorNick Parker20-Apr-03 16:57 
GeneralRe: Question about a edit box! Help! Pin
DuFF21-Apr-03 7:08
DuFF21-Apr-03 7:08 
GeneralI need help with MATLAB questions Pin
nxz420-Apr-03 11:17
nxz420-Apr-03 11:17 
GeneralRe: I need help with MATLAB questions Pin
Nick Parker20-Apr-03 16:51
protectorNick Parker20-Apr-03 16:51 
GeneralRe: I need help with MATLAB questions Pin
Anonymous20-Apr-03 21:52
Anonymous20-Apr-03 21:52 
GeneralRe: I need help with MATLAB questions Pin
Toni7821-Apr-03 11:58
Toni7821-Apr-03 11:58 
GeneralUsing the serial com port Pin
Q15002220-Apr-03 10:05
Q15002220-Apr-03 10:05 
GeneralRe: Using the serial com port Pin
anju20-Apr-03 17:38
anju20-Apr-03 17:38 
GeneralRe: Using the serial com port Pin
Toni7821-Apr-03 11:53
Toni7821-Apr-03 11:53 
GeneralWorker-Thread In Win32 Application Pin
ZarrinPour20-Apr-03 5:27
ZarrinPour20-Apr-03 5:27 
GeneralRe: Worker-Thread In Win32 Application Pin
Ravi Bhavnani20-Apr-03 6:34
professionalRavi Bhavnani20-Apr-03 6:34 
GeneralRe: Worker-Thread In Win32 Application Pin
Johann Gerell20-Apr-03 6:48
Johann Gerell20-Apr-03 6:48 
GeneralRe: Worker-Thread In Win32 Application Pin
Ravi Bhavnani20-Apr-03 12:09
professionalRavi Bhavnani20-Apr-03 12:09 

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.