Click here to Skip to main content
14,698,390 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How is this possible? Pin
Tim ONeil17-May-20 6:39
MemberTim ONeil17-May-20 6:39 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 7:28
mveRichard MacCutchan17-May-20 7:28 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 23:12
mveRichard MacCutchan17-May-20 23:12 
GeneralRe: How is this possible? Pin
Richard MacCutchan20-May-20 0:55
mveRichard MacCutchan20-May-20 0:55 
AnswerRe: How is this possible? Pin
Mircea Neacsu19-May-20 4:09
MemberMircea Neacsu19-May-20 4:09 
PraiseRe: How is this possible? Pin
Greg Utas19-May-20 4:37
professionalGreg Utas19-May-20 4:37 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 4:37
mveRichard MacCutchan19-May-20 4:37 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 4:57
MemberMircea Neacsu19-May-20 4: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 5:16
mveRichard MacCutchan19-May-20 5:16 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 6:08
MemberMircea Neacsu19-May-20 6:08 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 6:24
mveRichard MacCutchan19-May-20 6:24 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 7:07
MemberMircea Neacsu19-May-20 7:07 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 22:36
mveRichard MacCutchan19-May-20 22:36 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 3:40
MemberMircea Neacsu20-May-20 3:40 
GeneralRe: How is this possible? Pin
Richard MacCutchan20-May-20 0:22
mveRichard MacCutchan20-May-20 0:22 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 3:44
MemberMircea Neacsu20-May-20 3:44 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 5:18
mveRichard MacCutchan19-May-20 5:18 
AnswerRe: How is this possible? Pin
Richard MacCutchan19-May-20 22:38
mveRichard MacCutchan19-May-20 22:38 
QuestionQueryPerformanceCounter Pin
CalinNegru(fearless_)16-May-20 3:16
MemberCalinNegru(fearless_)16-May-20 3:16 
AnswerRe: QueryPerformanceCounter Pin
Greg Utas16-May-20 3:29
professionalGreg Utas16-May-20 3:29 
GeneralRe: QueryPerformanceCounter Pin
CalinNegru(fearless_)16-May-20 4:11
MemberCalinNegru(fearless_)16-May-20 4:11 
AnswerRe: QueryPerformanceCounter Pin
Richard MacCutchan16-May-20 3:58
mveRichard MacCutchan16-May-20 3:58 
GeneralRe: QueryPerformanceCounter Pin
CalinNegru(fearless_)17-May-20 0:00
MemberCalinNegru(fearless_)17-May-20 0:00 
GeneralProject Pin
Hayley Satjan15-May-20 1:32
MemberHayley Satjan15-May-20 1:32 
GeneralRe: Project Pin
Richard MacCutchan15-May-20 1:51
mveRichard MacCutchan15-May-20 1: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.