Click here to Skip to main content
15,886,103 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How is this possible? Pin
Tim ONeil17-May-20 5:39
Tim ONeil17-May-20 5:39 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 6:28
mveRichard MacCutchan17-May-20 6:28 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 22:12
mveRichard MacCutchan17-May-20 22:12 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 23:55
mveRichard MacCutchan19-May-20 23:55 
AnswerRe: How is this possible? Pin
Mircea Neacsu19-May-20 3:09
Mircea Neacsu19-May-20 3:09 
PraiseRe: How is this possible? Pin
Greg Utas19-May-20 3:37
professionalGreg Utas19-May-20 3:37 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 3:37
mveRichard MacCutchan19-May-20 3:37 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 3:57
Mircea Neacsu19-May-20 3:57 
Maybe you can add some explanations an I might learn something from this.

I'm using Visual Studio 2019 and it barks at me for template <class t=""> struct _node. I'm sorry but if I want to go ahead I need to change stack.h.

After I change it to template <class T> struct _node (that seems the only plausible alternative to me), and I put the my code in stack.cpp, all goes well until link time when it says it cannot find the implementation functions. This is normal (in my mind) because the templates haven't been instantiated. How is the compiler to know that it needs to generate a stack of "int" when compiling stack.cpp and how it can generate said stack when compiling main.cpp. I could probably force it to create one by placing an instantiation of stack<int> in stack.cpp. No one does anything like that.
Mircea

GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 4:16
mveRichard MacCutchan19-May-20 4:16 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 5:08
Mircea Neacsu19-May-20 5:08 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 5:24
mveRichard MacCutchan19-May-20 5:24 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 6:07
Mircea Neacsu19-May-20 6:07 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 21:36
mveRichard MacCutchan19-May-20 21:36 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 2:40
Mircea Neacsu20-May-20 2:40 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 23:22
mveRichard MacCutchan19-May-20 23:22 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 2:44
Mircea Neacsu20-May-20 2:44 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 4:18
mveRichard MacCutchan19-May-20 4:18 
AnswerRe: How is this possible? Pin
Richard MacCutchan19-May-20 21:38
mveRichard MacCutchan19-May-20 21:38 
QuestionQueryPerformanceCounter Pin
Calin Negru16-May-20 2:16
Calin Negru16-May-20 2:16 
AnswerRe: QueryPerformanceCounter Pin
Greg Utas16-May-20 2:29
professionalGreg Utas16-May-20 2:29 
GeneralRe: QueryPerformanceCounter Pin
Calin Negru16-May-20 3:11
Calin Negru16-May-20 3:11 
AnswerRe: QueryPerformanceCounter Pin
Richard MacCutchan16-May-20 2:58
mveRichard MacCutchan16-May-20 2:58 
GeneralRe: QueryPerformanceCounter Pin
Calin Negru16-May-20 23:00
Calin Negru16-May-20 23:00 
GeneralProject Pin
Hayley Satjan15-May-20 0:32
Hayley Satjan15-May-20 0:32 
GeneralRe: Project Pin
Richard MacCutchan15-May-20 0:51
mveRichard MacCutchan15-May-20 0:51 

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.