Home Bug Reports

Private Thread assignment

joejoe Member
Trivial (usage) bug in IceUtil/Thread.h... Copy ctor and assignment should be private, but are currently public :-
class ICE_UTIL_API Thread : virtual public IceUtil::Shared
{
public:
    /// ...
    Thread(const Thread&);		// Copying is forbidden
    void operator=(const Thread&);	// Assignment is forbidden

So the following compiles but raises linker errors :-
#include <Ice/Ice.h>
class MyThread : public IceUtil::Thread {
	virtual void run() { }
};
int main(int argc, char *argv[]) {
	MyThread t1, t2;
	t1 = t2;			// should raise compile error
	MyThread t3(t2);	// should raise compile error
	return 0;
}

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    Woops. That's not supposed to happen :) Thanks for the bug report.
Sign In or Register to comment.