Classes / structs:
Classes / structs
suggest changeNote that the only difference between the struct and class keywords is that by default, the member variables, member functions, and base classes of a struct are public, while in a class they are private. C++ programmers tend to call it a class if it has constructors and destructors, and the ability to enforce its own invariants; or a struct if it’s just a simple collection of values, but the C++ language itself makes no distinction.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents
11Loops
14keywords
17Pointers
19Classes / structs
26std::map
29std::any
38File I/O
39Streams
51Unions
56Lambdas
60SFINAE
62RAII
67Sorting
84RTTI
87Scopes
102Attributes
104Profiling
107Recursion
113Header files
117Iteration
125Alignment
133Optimization
134Semaphore
136Debugging
139Mutexes
141Unit testing
142decltype
146Contributors