Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <mutex>
#include <future>
using namespace std;
int main()
{
mutex m;
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <memory>
#include <forward_list>
#include <typeinfo>
#include <thread>
#include <mutex>
@mikeplavsky
mikeplavsky / move.cpp
Created August 29, 2020 19:52
Returning object from function
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <memory>
#include <forward_list>
#include <typeinfo>
using namespace std;
#include <iostream>
#include <typeinfo>
using namespace std;
struct Tag {
string name = "Test";
};
void check(Tag && t) {
(function run(){
for(var i=0; i<5; i++){
setTimeout(function log(){
console.log(i);
}, 100);
}
})();
const mul = x => y => z => x * y * z;
let y = {a:1, b:2, c:3}
let {a:x,...r} = y
[1,2,3,4,5].reduce( (r,x) => [...r,x], [7,8,9])
def accumulate():
res = 0
while True:
t = yield
if t == None:
return res
res += t
def tallies(ts):
pong_c = None
ping_c = None
def ping():
i = 0
while True:
res = yield
print(res)
i += 1
pong_c.send("ping")