New Learnings: Custom Comparator with STL, const int * const ptr, reference to pointer to const, Operator Overloading

Today, while implementing Huffman Codes (, I learned a few new Things which I thought must be shared:

  1. Adding a custom comparator with STL:
  2. Also in this I learned when and why and how you can overload operators in classes:
  3. Also we can’t overload operator= using friend :
  4. Why Operator Overloading doesn’t work for pointers:
    Also when overloading operators with friend function, one of them arguments must be an instance of the class or reference to it.
  5. The Differences between const int *, int * const, int const * const:
  6. Why cant I pass a non const pointer to a function taking a reference to a pointer to a const as its argument

Leave a Reply

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

You are commenting using your 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