effective C++: Ch1

    1. A default constructor is one that can be called without any arguments. Such a constructor either has no parameters or has a default value for every parameter
    2. copy by value for function parameters, which will invoke copy constructor
    3. A copy constructor is used to initialize a previously uninitialized object from some other object’s data.
    4. An assignment operator is used to replace the data of a previously initialized object with some other object’s data.
    5. The purpose of const on member functions is to identify which mem- ber functions may be invoked on const objects.

    6. STL iterators are modeled on pointers, so an iterator acts much like a T* pointer. Declaring an iterator const is like declaring a pointer const (i.e., declaring a T* const pointer): the iterator isn’t allowed to point to something different, but the thing it points to may be modified.

    7. difference of c++ from c: object-oriented, template, STL
    8. template<typename T>
      inline void callWithMax(const T& a, const T& b) {

      // because we don’t
      // know what T is, we // pass by reference-to-const

      f(a>b?a:b); }


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s