示例#1
0
文件: main.cpp 项目: CCJY/coliru
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();
}
示例#2
0
文件: main.cpp 项目: CCJY/coliru
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());
}
示例#3
0
文件: main.cpp 项目: CCJY/coliru
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();
}