C++ FAQ
/ Topics beginning with 'S'
Recent changes - 11 changed FAQs.
In a list,
or in a chain,
or here:
[4.1],
[4.2],
[6.3],
[6.12],
[10.3],
[15.22],
[27.15],
[35.13],
[35.14],
[35.15],
[39.6].
Translated into 16 languages.
English,
Belorussian / Minsk,
Bosnian / Serbian / Croatian,
Bulgarian,
Chinese (GB, Mainland),
Chinese (Big5, Taiwan),
French,
German,
Greek,
Korean,
Polish,
Portuguese,
Romanian,
Russian,
Spanish,
Turkish.
Mirrored in 11 countries.
USA,
France,
Germany,
Ireland,
Israel,
Italy,
Poland,
Portugal,
Spain,
Taiwan,
U.K..
|
C++ FAQ topics beginning with 'S'
[ A
| B
| C
| D
| E
| F
| G
| H
| I
| J
| K
| L
| M
| N
| O
| P
| Q
| R
| S
| T
| U
| V
| W
| X
| Y
| Z
]
- Safety with speed via inline functions ...
[9.4]
- Schoolwork problems ...
[5.2],
[5.3]
- Screen
- Security vs. Encapsulation ...
[7.8]
- Self-assignment (see also Operator overloading) ...
[12.1],
[12.2],
[12.3]
- Self-assignment ...
[12.1],
[12.2],
[12.3],
[27.10]
- Self-cleaning member objects ...
[17.10]
- Semantics of pointers ...
[31.1]
- Senior Developers ...
[6]
- Business-centricity vs. Techno-centricity ...
[6.5]
- C++ is a practical tool ...
[6.1]
- C++ is not a perfect tool ...
[6.2]
- Length of time needed to learn OO/C++ ...
[6.7]
- Size of the installed base ...
[6.6]
- Some advantages of Generic Programming ...
[6.4]
- Some advantages of OO ...
[6.3]
- Standardization of C++ ...
[6.12],
[6.13]
- Separate compilation model ...
[35.12],
[35.13],
[35.14],
[35.15]
- Separate the "good (happy) path" from the "bad path" (see also under Exceptions) ...
[17.4]
- Separation of specification from implementation ...
[21.12]
- Sequence points ...
[39.15],
[39.16]
- Serbian translation of this document ...
[2.4]
- Serialization ...
[36],
[36.1]
- Algorithm selection ...
[36.2]
- Binary format mechanics ...
[36.6]
- Binary format tradeoffs ...
[36.3]
- Caveats ...
[36.12]
- Cycles within graphs (definition) ...
[36.13]
- Graphs of objects (definition) ...
[36.13]
- Human-readable format mechanics ...
[36.5]
- Human-readable format tradeoffs ...
[36.3]
- Infinite recursion ...
[36.11]
- Inheritance but no pointers ...
[36.8]
- Joins within graphs (definition) ...
[36.13]
- No inheritance, no pointers ...
[36.7]
- Nodes within graphs (definition) ...
[36.13]
- Non-human-readable format mechanics ...
[36.6]
- Non-human-readable format tradeoffs ...
[36.3]
- Object identity ...
[36.11]
- Pointers with cycles or non-trivial joins ...
[36.11]
- Pointers with no cycles and no joins ...
[36.9]
- Pointers with no cycles and only "trivial" joins ...
[36.10]
- Simple types ...
[36.4]
- Text format mechanics ...
[36.5]
- Text format tradeoffs ...
[36.3]
- Trees of objects (definition) ...
[36.13]
- Version numbers of instance-data formats ...
[36.7]
- Serialize ...
[36.8]
- set_new_handler ...
[16.7]
- setprecision ...
[35.8]
- SFINAE (Substitution Failure Is Not An Error) (see also under Templates) ...
[35.11]
- shared_ptr ...
[26.13],
[34.6]
- Short-circuit operators (see also Operator overloading) ...
[13.9]
- Short-courses (one 40 hour workweek) ...
[6.7]
- short: choosing between integer sizes ...
[29.5]
- Shortest path in C++ ...
[5.3]
- Simple types, Serialization and ...
[36.4]
- Simplify function return types and parameter types (see also under Exceptions) ...
[17.3]
- Simplify propagating the error information up the stack (see also under Exceptions) ...
[17.2]
- Sister class: delegate to via virtual inheritance ...
[25.10]
- Sixty-four bit bytes (on some machines) ...
[26.5]
- Size of the C++ installed base ...
[6.6],
[6.8]
- Size-cost, and virtual functions ...
[20.4]
- Size-cost: can effect speed ...
[9.3]
- Size; One size does not fit all ...
[6.16],
[6.17],
[9.3],
[17.5],
[17.8],
[18.8],
[18.9],
[19.8],
[21.8],
[23.3],
[23.4],
[25.2],
[25.3],
[25.5],
[25.6],
[29.7],
[29.11],
[36.2],
[36.3],
[36.5],
[36.6]
- sizeof
- sizeof keyword ...
[26.1],
[26.2],
[26.5],
[26.6]
- Slicing ...
[17.13],
[17.16],
[20.8],
[22.5],
[31.8],
[34.4]
- Smalltalk ...
[30]
- Differences with C++ ...
[30.1]
- Dynamic type checking ...
[30.2]
- Inheritance differences ...
[30.4],
[30.5]
- Language wars vs. C++ ...
[6.5]
- Not an efficient way to learn OO/C++ ...
[28.3]
- Smart pointers ...
[13.3],
[16.16],
[16.22],
[17.10],
[34.6]
- Smoking out people who pretend to know C++ ...
[6.14]
- SO (Acronym) ...
[5.1]
- Software development is decision-making ...
[6.16],
[9.3],
[17.8],
[19.8],
[19.9],
[21.8],
[23.4],
[25.2],
[25.3],
[25.5],
[25.6],
[29.7],
[29.11],
[36.2],
[36.3],
[36.5],
[36.6]
- Solaris ...
[5.9]
- Solicitation for help with the C++ FAQ ...
[6.19]
- Sometimes "evil" things are the "least bad" alternative ...
[6.16]
- Sorting in C++ ...
[5.3]
- Source Code Reformatter
- Source filename extensions ...
[27.8]
- Source Styler for C++ (see Pretty printing) ...
[40.3]
- Space shuttle ...
[21.3]
- Space vehicle (example) ...
[25.5]
- Spaces: whitespace standards ...
[29.10]
- Spam ...
[5.13]
- Spanish translation of this document ...
[2.15]
- Spanning Trees in C++ ...
[5.3]
- Specialization (see also Inheritance) ...
[19.3]
- Specialization (see also under Templates) ...
[35.7],
[35.8]
- Specialization of part of a function (see also under Templates) ...
[35.9]
- Specification vs. implementation with inheritance ...
[21.11],
[21.12]
- Speed (see also under Templates) ...
[35.10]
- Speed and inline ...
[9.3]
- Speed of virtual functions ...
[20.4]
- Spock ...
[12.3],
[23.3]
- Square root of a negative number ...
[29.15]
- SSO (Acronym) ...
[5.1]
- Stack unwinding (see also under Exceptions) ...
[11.13],
[17.9]
- Stack unwinding during exception handling ...
[11.13],
[17.9]
- Standard headers ...
[27.4]
- Standard library ...
[29.9]
- Standardization issues ...
[5.9],
[6.12],
[6.13],
[30.1]
- Standards, coding ...
[27]
- Assignment operators check assignment-to-self ...
[12.1],
[27.10]
- Assignment operators return *this ...
[27.10]
- Assignment operators use const ...
[27.10]
- Avoid arrays ...
[16.17],
[17.11],
[21.5],
[34.1]
- Avoid bizarre syntax ...
[27.14]
- Avoid casting Derived** → Base** ...
[21.2]
- Avoid casting Foo** → Foo const** ...
[18.17]
- Avoid casting pointers ...
[16.25],
[18.17],
[21.2],
[23.12],
[27.11],
[30.2],
[30.3],
[37.5]
- Avoid char* (use a string-like class instead) ...
[13.6],
[17.11]
- Avoid converting array-of-Derived → kind-of Array-of-Base ...
[21.4]
- Avoid Derived** → Base**, Casting ...
[21.2]
- Avoid dynamically typed libraries ...
[37.5]
- Avoid explicitly calling destructors (sometimes okay) ...
[11.10]
- Avoid explicitly calling destructors on local objects ...
[11.5],
[11.6]
- Avoid Foo** → Foo const**, Casting ...
[18.17]
- Avoid hiding inherited public features ...
[21.1],
[21.6],
[21.7],
[21.8],
[21.9],
[23.9]
- Avoid hiding nested identifiers ...
[39.8]
- Avoid macros ...
[9.5],
[29.11],
[30.3],
[39.4],
[39.5],
[39.6]
- Avoid missing virtual on some base class dtors ...
[20.7]
- Avoid mixing malloc() and delete ...
[16.3]
- Avoid mixing new and free() ...
[16.3]
- Avoid mixing new T[n] with delete p ...
[16.12],
[16.13],
[26.11]
- Avoid mixing realloc() and new ...
[16.5]
- Avoid overabundance of try/catch blocks ...
[17.7]
- Avoid passing array-of-Derived as array-of-Base ...
[21.4],
[21.5]
- Avoid pointer casts ...
[16.25],
[18.17],
[21.2],
[23.12],
[27.11],
[30.2],
[30.3],
[37.5]
- Avoid preprocessor ...
[29.8]
- Avoid unnecessary global variables ...
[33.2],
[39.8]
- Avoid unnecessary use of "dumb" pointers ...
[34.6]
- Avoid zombie objects ...
[17.8]
- Bloodshed, Jihads, and Heat vs. Light ...
[27.1]
- Coding standards are never sufficient ...
[27.2]
- Coding standards are sometimes necessary ...
[27.2]
- const_cast ...
[18.13]
- Constructors should throw exceptions on failure ...
[17.8]
- Copy constructors use const ...
[27.10]
- Declare near first use ...
[27.7]
- Design classes from the outside-in ...
[13.13]
- Don't base C++ standards on C standards ...
[27.3],
[34.1]
- Don't test for NULL after new ...
[16.6]
- Don't test for NULL before delete ...
[16.8]
- Explicitly calling destructors (don't!) ...
[11.9]
- Header filename extensions ...
[27.9]
- Identifier naming conventions ...
[27.12]
- Initialization lists ...
[10.6],
[26.8],
[27.10]
- Law of the Big Three ...
[16.17],
[27.10]
- Macros that contain if ...
[39.4]
- Macros that contain multiple lines ...
[39.5]
- Macros that perform token pasting ...
[39.6]
- main() returns int, not void ...
[5.8],
[29.3]
- Multiple inheritance ...
[25.4]
- Never throw exceptions from a dtor ...
[17.9]
- Operator overloading ...
[27.10]
- Prefer ++i over i++ ...
[13.15]
- Source filename extensions ...
[27.8]
- static at file-scope (don't!) ...
[7.5]
- The Ellemtel coding guidelines ...
[27.13]
- Todd Hoff's coding guidelines ...
[27.13]
- Use a std::string object rather than a char* ...
[13.6],
[17.11]
- Use delete[] for arrays ...
[16.12]
- Use of the ternary ?: operator ...
[27.6]
- virtual destructors ...
[20.7],
[27.10]
- Whitespace pseudo-standards ...
[29.10]
- Star Trek ...
[23.3]
- Good of the many outweighs good of the few ...
[12.3],
[16.17]
- Transporter mechanism ...
[36.1]
- Star Trek, Good of the many outweighs good of the few ...
[12.3],
[16.17]
- Star Trek, Transporter mechanism ...
[36.1]
- Static
- Common linker errors due to static data members ...
[10.12],
[10.13]
- Define static const data members explicitly ...
[10.13]
- Define static data members explicitly ...
[10.11],
[10.12]
- Deinitialization order fiasco ...
[10.16]
- Function-scope static variables ...
[10.15],
[10.16],
[10.17],
[10.18],
[16.23]
- Initialization order fiasco ...
[10.14],
[10.15],
[10.17],
[10.18],
[26.9]
- Initializing static const data members ...
[10.13]
- Named Constructor Idiom using static ...
[10.8],
[16.21],
[16.24]
- static at file-scope (don't!) ...
[7.5]
- Static binding ...
[20.2],
[20.3],
[20.4]
- static const data members ...
[10.13]
- static const member data ...
[10.13]
- static create() methods ...
[10.8],
[16.21],
[16.24]
- static member data ...
[10.11],
[10.12],
[10.17],
[29.6]
- static member functions ...
[10.8],
[10.17],
[16.21],
[16.22],
[16.23],
[16.24],
[23.6],
[33.2]
- Static typing ...
[20.2],
[30.2],
[30.3]
- Status bar with MFC ...
[38.3]
- std and using ...
[27.5]
- std::
- std::auto_ptr ...
[17.10],
[23.6],
[26.13],
[34.6]
- std::bad_alloc (see also under Exceptions) ...
[16.6],
[16.7]
- std::boolalpha ...
[35.8]
- std::count ...
[27.5]
- std::cout ...
[27.5]
- std::endl vs. '\n' for ending output lines ...
[15.7]
- std::find_if ...
[37.3]
- std::istream and clear() (input/output) ...
[15.3]
- std::istream and eof (input/output) ...
[15.2],
[15.5]
- std::istream and if (std::cin >> foo) (input/output) ...
[39.2],
[39.3]
- std::istream and if (std::cout << foo) (input/output) ...
[39.1]
- std::istream and ignore() (input/output) ...
[15.3]
- std::istream and invalid input characters (input/output) ...
[15.2],
[15.3]
- std::istream and remembering bad state (input/output) ...
[15.6]
- std::istream and while (std::cin >> foo) (input/output) ...
[15.4]
- std::istream input operator: operator>> ...
[15.4],
[15.10],
[39.2],
[39.3]
- std::istream operator>> (input/output) ...
[15.10]
- std::istringstream ...
[39.2],
[39.3]
- std::map<Key,Value> ...
[8.8],
[34.2]
- std::numeric_limits<T> ...
[15.3],
[15.6],
[35.8]
- std::ostream operator<< (input/output) ...
[15.8],
[15.9]
- std::ostream operator<< (virtual) (input/output) ...
[15.11]
- std::ostream output operator: operator<< ...
[8.4],
[15.8],
[15.9],
[39.1]
- std::ostream output operator; virtual: operator<< ...
[15.11]
- std::ostringstream ...
[35.8],
[39.1]
- std::rand() ...
[17.14]
- std::runtime_error (see also under Exceptions) ...
[17.12]
- std::set_new_handler ...
[16.7]
- std::setprecision ...
[35.8]
- std::shared_ptr ...
[26.13],
[34.6]
- std::string: Better than char* ...
[13.6],
[17.11]
- std::stringstream ...
[39.1],
[39.2],
[39.3]
- std::vector ...
[27.5]
- std::vector<T> ...
[10.5],
[16.19],
[16.20],
[21.4],
[21.5],
[34.1],
[37.3]
- std::vector<T> elements accessed by pointers ...
[34.3]
- std::vector<T> storage is contiguous ...
[34.3]
- std::auto_ptr ...
[17.10],
[23.6],
[26.13],
[34.6]
- std::bad_alloc (see also under Exceptions) ...
[16.6],
[16.7]
- std::boolalpha ...
[35.8]
- std::count ...
[27.5]
- std::cout ...
[27.5]
- std::endl vs. '\n' for ending output lines ...
[15.7]
- std::find_if ...
[37.3]
- std::istream and clear() (input/output) ...
[15.3]
- std::istream and eof (input/output) ...
[15.2],
[15.5]
- std::istream and if (std::cin >> foo) (input/output) ...
[39.2],
[39.3]
- std::istream and if (std::cout << foo) (input/output) ...
[39.1]
- std::istream and ignore() (input/output) ...
[15.3]
- std::istream and invalid input characters (input/output) ...
[15.2],
[15.3]
- std::istream and remembering bad state (input/output) ...
[15.6]
- std::istream and while (std::cin >> foo) (input/output) ...
[15.4]
- std::istream input operator: operator>> ...
[15.4],
[15.10],
[39.2],
[39.3]
- std::istream operator>> (input/output) ...
[15.10]
- std::istringstream ...
[39.2],
[39.3]
- std::map<Key,Value> ...
[8.8],
[34.2]
- std::numeric_limits<T> ...
[15.3],
[15.6],
[35.8]
- std::ostream operator<< (input/output) ...
[15.8],
[15.9]
- std::ostream operator<< (virtual) (input/output) ...
[15.11]
- std::ostream output operator: operator<< ...
[8.4],
[15.8],
[15.9],
[39.1]
- std::ostream output operator; virtual: operator<< ...
[15.11]
- std::ostringstream ...
[35.8],
[39.1]
- std::rand() ...
[17.14]
- std::runtime_error (see also under Exceptions) ...
[17.12]
- std::set_new_handler ...
[16.7]
- std::setprecision ...
[35.8]
- std::shared_ptr ...
[26.13],
[34.6]
- std::string: Better than char* ...
[13.6],
[17.11]
- std::stringstream ...
[39.1],
[39.2],
[39.3]
- std::vector ...
[27.5]
- std::vector<T> ...
[10.5],
[16.19],
[16.20],
[21.4],
[21.5],
[34.1],
[37.3]
- std::vector<T> elements accessed by pointers ...
[34.3]
- std::vector<T> storage is contiguous ...
[34.3]
- stdio.h (see "cstdio header") ...
[15.1]
- STL ...
[37.3]
- STL Error-Message filter ...
[35.17]
- Stoer, J. ...
[29.17],
[37.7]
- Storage is contiguous in std::vector<T> ...
[34.3]
- Strange syntax: use only when you must ...
[27.14]
- Strategy vs. tactics ...
[25.1]
- Stream of bits, Converting to/from objects ...
[36.1]
- Striding the cache (see Cache Misses) ...
[13.11],
[13.12]
- String data, serialization in human-readable format ...
[36.5]
- String data, serialization in non-human-readable format ...
[36.6]
- string: Better than char* ...
[13.6],
[17.11]
- stringify() ...
[35.8],
[39.1],
[39.3]
- stringstream ...
[39.1],
[39.2],
[39.3]
- struct keyword ...
[7.1],
[7.9]
- Students read this first ...
[5.2]
- Style guidelines (see Coding standards) ...
[27]
- StyleManager, ProFactor (see Pretty printing) ...
[40.3]
- Subclass
- Derived classes that aren't subtypes ...
[30.5]
- See also Derived classes ...
[19.3]
- Subject: line of a posting (see also Netiquette) ...
[5.7]
- Submarine, Nuclear ...
[21.2],
[21.3]
- Subscript operator comes in pairs: operator[] ...
[13.9],
[18.12]
- Subscript operator for Matrix ...
[13.10],
[13.11],
[13.12]
- Subscript operator: operator[] ...
[8.3],
[13.4],
[13.10],
[13.11],
[13.12]
- Substitutability ...
[21.3],
[21.4],
[21.6],
[21.7],
[21.8],
[21.9],
[21.11]
- Substitution Failure Is Not An Error (see also under Templates) ...
[35.11]
- Subtle bugs ...
[6.15]
- Arrays ...
[16.17],
[17.11],
[21.5],
[34.1]
- Casting Derived** → Base** ...
[21.2]
- Casting Foo** → Foo const** ...
[18.17]
- Casting pointers ...
[16.25],
[18.17],
[21.2],
[23.12],
[27.11],
[30.2],
[30.3],
[37.5]
- char* (use a string-like class instead) ...
[13.6],
[17.11]
- Converting array-of-Derived → kind-of Array-of-Base ...
[21.4]
- Derived** → Base**, Casting ...
[21.2]
- Explicitly calling destructors (sometimes okay) ...
[11.10]
- Explicitly calling destructors on local objects ...
[11.5],
[11.6]
- Foo** → Foo const**, Casting ...
[18.17]
- Hiding inherited public features ...
[21.1],
[21.6],
[21.7],
[21.8],
[21.9],
[23.9]
- Macros ...
[9.5],
[29.11],
[30.3],
[39.4],
[39.5],
[39.6]
- Missing virtual on some base class dtors ...
[20.7]
- Mixing malloc() and delete ...
[16.3]
- Mixing new and free() ...
[16.3]
- Mixing new T[n] with delete p ...
[16.12],
[16.13],
[26.11]
- Mixing realloc() and new ...
[16.5]
- Passing array-of-Derived as array-of-Base ...
[21.4],
[21.5]
- Pointer casts ...
[16.25],
[18.17],
[21.2],
[23.12],
[27.11],
[30.2],
[30.3],
[37.5]
- Preprocessor ...
[29.8]
- Unnecessary global variables ...
[33.2],
[39.8]
- Unnecessary use of "dumb" pointers ...
[34.6]
- Subtypes that aren't derived classes ...
[30.5]
- Suffixes: numeric literal suffixes ...
[29.12]
- Superclass (see also Inheritance) ...
[19.3]
- Symmetry is good, but not the greatest good ...
[23.3]
- Syntactic sugar ...
[13.1]
|