This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.fromCallback = fn => | |
new Promise((r, j) => { | |
fn((err, result) => err ? j(err) : r(result)); | |
}); | |
Promise.prototype.nodeify = function (cb) { | |
cb && this.then(r => cb(null, r), cb); | |
return cb ? undefined : this; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef OPTIONAL_HPP | |
#define OPTIONAL_HPP | |
#include <utility> | |
namespace gamesolver { | |
template <typename T> | |
class optional { | |
public: |
OlderNewer