C++ style guide: Difference between revisions

Jump to navigation Jump to search
402 bytes added ,  23 August 2021
m
Add new recommendation on references
m (Tweak type casting language)
m (Add new recommendation on references)
Line 173: Line 173:


== C++ features ==
== C++ features ==
=== references ===
Use references when passing variables that will be changed to subroutines rather
than the C-style method of passing pointers.
When passing variables that are large, but will not be changed in a subroutine (read-only)
, consider using 'const' references.  This helps avoid overflowing the finite stack capacity
of a program while still ensuring that read-only access is enforced.


=== C++11 features ===
=== C++11 features ===
Line 178: Line 187:
C++11 features are generally allowed. Check if the feature you want to
C++11 features are generally allowed. Check if the feature you want to
use has been already used.  If not, ask on the mailing list.
use has been already used.  If not, ask on the mailing list.


=== std::string ===
=== std::string ===
1,072

edits

Navigation menu