Click here to Skip to main content
15,919,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to take the address of a smart pointer? Pin
Miszou9-Sep-03 7:13
Miszou9-Sep-03 7:13 
GeneralTemplate function in a class Pin
ns9-Sep-03 5:50
ns9-Sep-03 5:50 
GeneralRe: Template function in a class Pin
geo_m9-Sep-03 7:02
geo_m9-Sep-03 7:02 
GeneralRe: Template function in a class Pin
Alvaro Mendez9-Sep-03 7:37
Alvaro Mendez9-Sep-03 7:37 
GeneralRe: Template function in a class Pin
ns9-Sep-03 8:37
ns9-Sep-03 8:37 
GeneralRe: Template function in a class Pin
antlers9-Sep-03 9:20
antlers9-Sep-03 9:20 
GeneralRe: Template function in a class Pin
ns9-Sep-03 10:19
ns9-Sep-03 10:19 
GeneralRe: Template function in a class Pin
ns9-Sep-03 10:09
ns9-Sep-03 10:09 
It didnt recognize this as a function belonging to the class in which it is defined (in the h file).
(BTW I also tried putting the template function body in the cpp file....no go)
template <class T>
T *
s_file::p_data (unsigned int line) {
  return ((T *) _p_data + line * _p_samples);
}


so I since know that T can be either unsigned short or unsigned int in this program I thought I'd overload.but the argument list isnt unique!! So obviously these wont work:

  unsigned char *
  s_file::p_data (unsigned int line) {
  return ((unsigned char *) _p_data + line * _p_samples);
}


  unsigned short *
  s_file::p_data (unsigned int line) {
  return ((unsigned short *) _p_data + line * _p_samples);
}


so I need to make something different in each argument list, but what? _p_data is a void*, and _p_samples is an int (both members of the class s_file..........

Thanks,
ns
GeneralRe: Template function in a class Pin
Alvaro Mendez9-Sep-03 10:19
Alvaro Mendez9-Sep-03 10:19 
GeneralRe: Template function --thanks! Pin
ns10-Sep-03 4:06
ns10-Sep-03 4:06 
GeneralMicrosoft Visual C++ Runtime Error/Windows XP Please Help Pin
Diaweb9-Sep-03 5:50
Diaweb9-Sep-03 5:50 
GeneralSTL header files Pin
Anonymous9-Sep-03 5:20
Anonymous9-Sep-03 5:20 
GeneralRe: STL header files Pin
Alvaro Mendez9-Sep-03 5:39
Alvaro Mendez9-Sep-03 5:39 
Questionhow to login NT neighbor in program Pin
wheregone9-Sep-03 5:01
wheregone9-Sep-03 5:01 
AnswerRe: how to login NT neighbor in program Pin
David Crow9-Sep-03 6:00
David Crow9-Sep-03 6:00 
GeneralRe: how to login NT neighbor in program Pin
wheregone9-Sep-03 16:49
wheregone9-Sep-03 16:49 
GeneralRe: how to login NT neighbor in program Pin
David Crow10-Sep-03 3:35
David Crow10-Sep-03 3:35 
QuestionHow to retrieve data from a list box Pin
Deepak Samuel9-Sep-03 4:51
Deepak Samuel9-Sep-03 4:51 
AnswerRe: How to retrieve data from a list box Pin
Braulio Dez9-Sep-03 5:46
Braulio Dez9-Sep-03 5:46 
Generalusing a class in managed c# from an unmanaged c++ class Pin
morefalt9-Sep-03 4:46
morefalt9-Sep-03 4:46 
GeneralRe: using a class in managed c# from an unmanaged c++ class Pin
Joel Matthias9-Sep-03 8:21
Joel Matthias9-Sep-03 8:21 
QuestionHow do you put a table into a dialog... Pin
molin9-Sep-03 4:46
molin9-Sep-03 4:46 
AnswerRe: How do you put a table into a dialog... Pin
David Crow9-Sep-03 5:49
David Crow9-Sep-03 5:49 
AnswerRe: How do you put a table into a dialog... Pin
valikac9-Sep-03 5:50
valikac9-Sep-03 5:50 
Generaldefining _WIN32_WINNT 0x0500 in VC6 Pin
John M. Drescher9-Sep-03 4:11
John M. Drescher9-Sep-03 4:11 

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.