diff --git a/include/argument_parser.hpp b/include/argument_parser.hpp index 73f2378..ecd509b 100644 --- a/include/argument_parser.hpp +++ b/include/argument_parser.hpp @@ -224,6 +224,7 @@ namespace argument_parser { invoked(other.invoked) {} argument& operator=(argument const& other) { + if (this == &other) return *this; this->~argument(); new(this) argument{other}; return *this; @@ -503,4 +504,4 @@ namespace argument_parser { }; } -#endif // ARGUMENT_PARSER_HPP \ No newline at end of file +#endif // ARGUMENT_PARSER_HPP