function.hpp:

- Added self-assignment check in operator= and set()

function_template.hpp:
	- Added self-assignment check in operator= and set()


[SVN r10431]
This commit is contained in:
Douglas Gregor
2001-06-26 13:38:58 +00:00
parent 0270911a43
commit 07c66d01fa
2 changed files with 18 additions and 0 deletions

View File

@ -1044,6 +1044,9 @@ namespace boost {
// Assignment from another BOOST_FUNCTION_FUNCTION
BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f)
{
if (this == &f)
return *this;
clear();
if (!f.empty()) {
@ -1064,6 +1067,9 @@ namespace boost {
// Assignment from another BOOST_FUNCTION_FUNCTION
void set(const BOOST_FUNCTION_FUNCTION& f)
{
if (this == &f)
return;
clear();
if (!f.empty()) {
@ -1624,6 +1630,9 @@ namespace boost {
// Assignment from another BOOST_FUNCTION_FUNCTION
BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f)
{
if (this == &f)
return *this;
clear();
if (!f.empty()) {
@ -1644,6 +1653,9 @@ namespace boost {
// Assignment from another BOOST_FUNCTION_FUNCTION
void set(const BOOST_FUNCTION_FUNCTION& f)
{
if (this == &f)
return;
clear();
if (!f.empty()) {