No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Channel.hpp
Makefile
README.md
test.cpp

README.md

go-channel-in-cpp

$ git clone https://github.com/codesome/go-channel-in-cpp.git
$ cd go-channel-in-cpp/
$ vi test.cpp
// now uncomment the test section that you want
$ make test

Example usage

Create channel object

Channel<int> my_chan;

Adding data to channel buffer

my_chan.add(30);

Retrieving data from channel

bool is_closed;
int data = my_chan.retrieve(&is_closed);

if(!is_closed) {
    cout << "Data retrieved is " << data << endl;
} else {
    cout << "Channel is closed, so data retrieved is junk value" << endl;
}