fix return value of operator=

Also, add files generated by cmake to gitignore