Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-09-30 06:45:33


Hello,

test_thread.cpp contains the following line of code which vacpp flags as
invalid.

   BOOST_TEST(thrd == boost::thread());

The above line binds an rvalue (boost::thread()) to a const reference
(bool operator==(thread const &)) which, according to 8.5.3(5) requires
a callable copy constructor for boost::thread but boost::thread is
derived from boost::noncopyable.

Attached is a fix for this. If anyone agrees, I can apply it to the
release branch.

Markus


*** test_thread.cpp.~1.11.2.1.~ Thu Sep 26 11:25:42 2002
--- test_thread.cpp Mon Sep 30 13:44:15 2002
***************
*** 42,52 ****
          boost::thread& parent;
      };
  
! void comparison_thread(boost::thread& parent)
      {
          boost::thread thrd;
          BOOST_TEST(thrd != parent);
! BOOST_TEST(thrd == boost::thread());
      }
  }
  
--- 42,53 ----
          boost::thread& parent;
      };
  
! void comparison_thread(boost::thread & parent)
      {
          boost::thread thrd;
          BOOST_TEST(thrd != parent);
! boost::thread thrd2;
! BOOST_TEST(thrd == thrd2);
      }
  }
  


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk