self assignment error. you can write check or use copy-and-swap idiom.
see http://www.cplusplus.com/articles/y8hv0pDG/