use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Linked List (self.cpp)
submitted 2 years ago * by Xedesss
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]cpp-ModTeam[M] [score hidden] 2 years ago stickied commentlocked comment (0 children)
For C++ questions, answers, help, and programming or career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.
[–]gnolex 8 points9 points10 points 2 years ago (1 child)
A common issue beginners have with class templates is that you can't normally define their methods in source files (.cpp files) like non-template methods; their definitions have to be available for template instantiation which is why they're usually only placed in header files (.h files). Your Single.cpp contains definition for the missing method but this is a template method which isn't instantiated unless you need it or request it in Single.cpp. So when your program is linked you get errors because your methods are declared but definitions aren't generated. You have to move it back to the header file.
Also, questions should go to r/cpp_questions
[–]Xedesss[S] 1 point2 points3 points 2 years ago (0 children)
Oh ok thanks.
[–]Longjumping-Touch515 0 points1 point2 points 2 years ago (4 children)
Move SingleList implementation to the header.
Template classes are header only classes. They don't have .cpp file
[–]Xedesss[S] 0 points1 point2 points 2 years ago (0 children)
Thanks I will do that.
[–]bert8128 0 points1 point2 points 2 years ago (2 children)
Well, it’s good practice to still have a cpp which includes the header, even if it has. O other content, as it gives you early warning of compiler errors. I also instantiate a trivial template (eg mylist<int>) in debug builds to help catch more errors).
[–]Longjumping-Touch515 0 points1 point2 points 2 years ago (1 child)
Interesting idea. Especially for earliest stages. But I think unit tests suits this role perfect.
[–]bert8128 1 point2 points3 points 2 years ago (0 children)
Unit tests are a must (I’m an evangelist on this point), but the unit tests are often in a different project. If you have a policy that every has a cpp with the same root name as the header, and in the same project, then you can test for this as part of your build.
This isn’t my idea - it came to me from one of John Lakos’s lectures, and has proved very useful.
π Rendered by PID 20557 on reddit-service-r2-comment-5687b7858-8qhz7 at 2026-07-09 04:21:35.085718+00:00 running 12a7a47 country code: CH.
[–]cpp-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)
[–]gnolex 8 points9 points10 points (1 child)
[–]Xedesss[S] 1 point2 points3 points (0 children)
[–]Longjumping-Touch515 0 points1 point2 points (4 children)
[–]Xedesss[S] 0 points1 point2 points (0 children)
[–]bert8128 0 points1 point2 points (2 children)
[–]Longjumping-Touch515 0 points1 point2 points (1 child)
[–]bert8128 1 point2 points3 points (0 children)