This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct foo { | |
foo& operator=(const foo& other) = delete; // foo is not copy-assignable | |
}; | |
void bar() { | |
foo f1; | |
foo& r1 = f1; // Ok. r1 is reference to f1. | |
foo& r2 = r1; // ok. r2 is refernce to r1 which is semanticly the value f1. | |
r2 = r1; // Error. Semantics implies value assign (although both sides are references) and foo instance f1 is not assignable. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <boost/thread.hpp> | |
using namespace std; | |
using boost::thread; | |
using boost::mutex; | |
mutex a; | |
const int THREAD_COUNT = 10; |