int main() { Proxy<Item> item; item->foo(); std::cout << "\nWith std::string:" << std::endl; Proxy<std::string> s; std::cout << "\nPushing back a character: " << std::endl; s->push_back('a'); std::cout << "\nClearing the string: " << std::endl; s->clear(); }
int main() { Proxy<std::string, Policies::MutexLock> string; if (auto str = string.lock()) { TRACE(str->push_back('a')); TRACE(str->push_back('b')); TRACE(str->push_back('c')); } TRACE(std::cout << string << std::endl); TRACE(string->clear()); }
int main() { Proxy<std::string, Policies::MutexLock> string; if (auto str = string.lock()) { str->push_back('a'); str->push_back('b'); str->push_back('c'); } std::cout << "\nPrinting the string:" << std::endl; std::cout << string << std::endl; std::cout << "\nClearing the string:" << std::endl; string->clear(); }