3 ms·
For some guidelines take a look at https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md https://github.com/isocpp/CppCoreGuidelines/blo
by jbandela1 10y ago
For some guidelines take a look at
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...
If you want to look up some information about the C++ library, look at http://en.cppreference.com/w/ http://en.cppreference.com/w/
Here is my advice if you are learning C++ for the first time.
1. Use the latest released version of either GCC, Clang (preferrable) or Visual C++ if you want the best IDE
2. Do NOT start off with pointers. Doing so will only confuse and frustrate you.
3. Use std::string and std::vector. Learn about the std::algorithm. Learn about lambdas
4. Learn about RAII, constructors, and destructors. Focus on invariants - how you set them up and how you maintain them.
5. Learn about exceptions and exception safety
6. Learn about references and polymorphism
7. Learn about dynamic memory and std::unique_ptr
8. Learn about copy/move construction and assignment
9. Learn about std::shared_ptr
10. Implement your own version of std::vector. You will learn about memory management and pointers by implementing the iterators.
11. Learn about std::list and std::forward_list
12. Implement your versions of both. You will learn a lot about pointers.
13. Analyze the exception safety of your implemented versions of std::vector, std::list, and std::forward_list. Make sure you do not leak memory or end up in an invalid state.
This should get you acquainted with the basics. Now here is how to test yourself in various areas to see how comfortable you are.
Templates:
Implement std::tuple
Memory management:
Learn about memory allocation strategies and implement in an allocator that you can use with std::vector or std::list
Unions:
Implement std::string small-string optimization
Atomics/memory model:
Implement an atomic shared_ptr, where multiple threads can access the same shared_ptr atomically