Link Details

Link 1095875 thumbnail
User 225256 avatar

By mswatcher
Submitted: Jan 14 2014 / 13:44

There has been a lot of talk about design patterns, but not so much about code patterns, also referred to as idioms. A code pattern describes typical general code for common operations. This article focuses on operator patterns in C++. Not all classes need their own operators, but small classes which often represents some kind of value, will very often need a set of operators. Further, classes that use dynamic memory (heap allocation) must implement a copy constructor and an assignment operator (in addition to a destructor) if they are going to be copy able. (ref. The Big Three Law (B3L(see C++ FAQ).
  • 2
  • 0
  • 51
  • 46

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)

Voters Against This Link (0)

    Written by: Bert Belder
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Debugging JavaScript
    2. OO JS
    3. JSON
    4. Ajax
    5. REST