Google


   


You are here: CodeIdol.com > C++ > C++ Coding Standards: 101 Rules, Guidelines, and Best Practices > None27.Prefer The Canonical Forms Of Arithmetic And Assignment Operators

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

C++ Coding Standards: 101 Rules, Guidelines, and Best Practices



None 27. Prefer the canonical forms of arithmetic and assignment operators SummaryDiscussionExamplesExceptionsReferences...



If you a+b, also a+=b: When defining binary arithmetic operators, provide their assignment versions as well, and write to minimize duplication and maximize efficiency....

read more: Summary


In general, for some binary operator @ (be it +, -, *, and so on), you should define its assignment version such that a @=...

read more: Discussion


Example: An implementation of += for strings. When concatenating strings, it is useful to know the length in advance so as to allocate memory only...

read more: Examples


In some cases (e.g., operator*= on complex numbers), an operator might mutate its left-hand side so significantly that it can be more advantageous to implement...

read more: Exceptions


[Alexandrescu03a] • [Cline99] § • [Meyers96] §22 • [Sutter00] §20...

read more: References

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

You are here: CodeIdol.com > C++ > C++ Coding Standards: 101 Rules, Guidelines, and Best Practices > None27.Prefer The Canonical Forms Of Arithmetic And Assignment Operators


ADBRITE ads links
   
Related tags







Popular Categories
Unix books and guides

AJAX popular information
C# language guides
Windows books and cookbooks

.......








Business Key Top Sites

be number one
rate your site


Вот изготовление визиток врачей

    С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.

    Русский Polski Francais Deutsch
    support sitemap terms

© CodeIdol Labs, 2007 - 2009