Skip to content

Latest commit

 

History

History
205 lines (129 loc) · 12 KB

c++.md

File metadata and controls

205 lines (129 loc) · 12 KB

Sites

Standard ISO C++
C++ Language Reference
Standard C++ Library Reference
Cpp Reference Page

Official C++ Forum
Old C++ Language Reference (C++98)

C++ Online Shell

Microsoft Developer Blogs

Compiler Explorer Online

C++ Microsoft Documentation

C/C++ preprocessor reference
Pragma directives and the __pragma keyword
Include Guard (Wikipedia)

Stringizing operator (#) (C++ Preprocessor doc)

Books

C++ Basics

Basic concepts
Preprocessor Directives
Implementation defined behavior control (pragmas)
Macros
Pointers
Classes
Inheritance
Polymorphism

Non-static data members

Raw Pointers (Microsoft Docs - C++ Reference)
Smart Pointers (Modern C++) (Microsoft Docs - Modern C++ Reference)

get_pointer_safety (C++ Reference)

Modern C++

Modules (C++20)
Concepts (C++20) [1]

MSVC constexpr function 'xyz' cannot result in a constant expression
constexpr - function cannot be used in a constant expression

Good Practices

The Ultimate Question of Programming, Refactoring, and Everything

Google C++ Code Style Guidelines
Microsoft Naming Guidelines
C++ Best Practices by Jason Turner

Why does Microsoft use the “g_” naming convention with its DirectX10 pipeline variables? (StackOverflow)
Making Wrong Code Look Wrong (Joel On Software Blog)
Good Examples of Hungarian Notation? (StackOverflow)
Rediscovering Hungarian Notation (codingthriller blog)

SOLID principles implementation for C (StackOverflow)

Use of "stdafx.h"
What is “stdafx.h” used for in Visual Studio?

Toolchains

LLVM/CLang

LLVM
LLDB - Debugger of the LLVM project

Clang/LLVM Support in Visual Studio

ISO C++ Support in Clang

Problems
Clang fails to compile C++ (C++ forum)

Debugging

Valgrind - tools to check memory leaks, memory debugging and profilling application

Intellisense

IntelliSense (Visual Studio Code Docs)

Enable c++17 intellisense open folder visual studio ninja-clang

Problems with Intellisense CLang in Visual Studio and Visual Studio Code

namespace "std" has no member "cout"
namespace "std" has no member "cout"

CMake

CMake projects in Visual Studio (Microsoft Docs)

How to enable C++17 in CMake

Visual Studio

Create a C++ console app project
Popular keyboard shortcuts for Visual Studio
Visual Studio 2019 Release Notes

CLion

How can I configure LLVM Clang 6.0 with CLION 2018.1

API

WinAPI and Windows libraries

##List of Microsoft Windows application programming interfaces and frameworks (wikipedia)##

Get Started with Win32 and C++ (Microsoft Docs)
theForger's Win32 API Programming Tutorial

Handles and Data Types (Windows Programming - wikibooks)
Windows Data Types (handlers) (Microsoft Docs)
STRICT Type Checking (Microsoft Docs)

What is a Windows Handle? (StackOverflow)
What is __stdcall? (StackOverflow)
x86 calling conventions (Wikipedia)
Argument Passing and Naming Conventions (Microsoft Docs)
Calling conventions demystified (codeproject.com)

Using the Windows Headers (Microsoft Docs)
Header Annotations (Microsoft Docs)
Using SAL Annotations to Reduce C/C++ Code Defects (Microsoft Docs)

MFC Desktop Applications (Microsoft Docs)
Component Object Model (Wikipedia)
ATL COM Desktop Components

COM API documentation
DXGI API documentation

Windows Runtime C++ Template Library (WRL)
ComPtr (Smart Pointer) Class (WRL API Documentation)
WinRT (C++17)

Libraries

SDL 2.0

Testing

C++ Unit Testing in Visual Studio 2017+ (Microsoft Blog)
Comparison of C++ unit test frameworks (StackOverflow Oct 28 '08)
List of C++ unit testing frameworks (Wikipedia)

Forum discussions

UML class diagram to code translation

Other

Portable Executable (PE) - Windows file format (Wikipedia)
pdb files as linker input (Microsoft Linker Docs)

Things to Remember

Concepts

  • lvalue vs rvalue
  • object lifetime
  • scope
  • implicit conversion
  • compile time vs runtime
  • resource acquisition is initialization (RAII)
  • memory (resource) management

Template and Auto Type Deduction

  • There are three cases of template type deduction:

    • ParamType is a pointer or reference type, but not a universal reference. (Universal references are described in Item 24. At this point, all you need to know is that they exist and that they’re not the same as lvalue references or rvalue references.)

    • ParamType is a universal reference.

    • ParamType is neither a pointer nor a reference.

  • During template type deduction, arguments that are references are treated as non-references, i.e., their reference-ness is ignored.

  • When deducing types for universal reference parameters, lvalue arguments get special treatment.

  • When deducing types for by-value parameters, const and/or volatile arguments are treated as non-const and non-volatile.

  • During template type deduction, arguments that are array or function names decay to pointers, unless they’re used to initialize references.

  • auto type deduction is usually the same as template type deduction, but auto type deduction assumes that a braced initializer represents a std::initializer_list, and template type deduction doesn’t.

  • auto in a function return type or a lambda parameter implies template type deduction, not auto type deduction.