Ignore:
Timestamp:
Mar 20, 2019, 3:42:24 PM (3 years ago)
Author:
tdelisle <tdelisle@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
709e0e0
Parents:
13b1b1d
Message:

Clean existing coroutines using std::experimental::suspend_never and fixed Format coroutines to use RAII

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/concurrency/examples/counter.cpp

    r13b1b1d r571bf75  
    1 #include "base.hpp"
     1#include <iostream>
     2#include <experimental/coroutine>
    23
    34struct counter_cor {
     
    78                }
    89
    9                 auto initial_suspend() { return suspend_never(); }
    10                 auto final_suspend()   { return suspend_never(); }
     10                auto initial_suspend() { return std::experimental::suspend_never(); }
     11                auto final_suspend()   { return std::experimental::suspend_never(); }
    1112
    1213                void return_void() {}
     
    4748        std::cout << "Counter: called\n";
    4849        for(unsigned i = 1;; i++) {
    49                 co_await suspend_always{};
     50                co_await std::experimental::suspend_always{};
    5051                std::cout << "Counter: Resumed " << i << " time(s)\n";
    5152        }
Note: See TracChangeset for help on using the changeset viewer.