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
int main(int argc, char** argv) { | |
const auto n = argc; | |
[=] () mutable { | |
return ++n; | |
}; | |
} |
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
#include <thread> | |
#include <atomic> | |
#include <iostream> | |
int x, y; | |
int r1, r2; | |
int main() { | |
auto th1 = std::thread{[] { | |
r1 = x; |
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
#include <thread> | |
#include <atomic> | |
#include <iostream> | |
int x, y; | |
int r1, r2; | |
int main() { | |
auto th1 = std::thread{[] { | |
y = 1; |
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
#include <memory> | |
inline int32_t murmur_hash_3_finalizer(int32_t key) { | |
key ^= key >> 16; | |
key *= 0x85ebca6b; | |
key ^= key >> 13; | |
key *= 0xc2b2ae35; | |
key ^= key >> 16; | |
return key; |
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
#include <iostream> | |
struct Foo { | |
~Foo() { std::cout << "~Foo()\n"; } | |
}; | |
struct Bar { | |
Foo foo; | |
~Bar() { std::cout << "~Bar()\n"; } | |
}; |
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
#include <vector> | |
#include <functional> | |
#include <algorithm> | |
#include <utility> | |
#include <type_traits> | |
#include <iostream> | |
template<typename T> auto read_vector() { | |
return std::vector<T>{std::istream_iterator<T>{std::cin}, std::istream_iterator<T>{}}; | |
} |
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
#include <vector> | |
#include <functional> | |
#include <algorithm> | |
#include <iterator> | |
#include <iostream> | |
#include <utility> | |
#include <type_traits> | |
template<typename T> auto read_vector() { | |
return std::vector<T>{std::istream_iterator<T>{std::cin}, std::istream_iterator<T>{}}; |
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
#include <utility> | |
struct Foo { | |
void method_one(const int& a, bool b) {} | |
template<typename... T> using mem_fn_ptr = void (Foo::*)(T...); | |
// 1 | |
template<typename... T> void process(mem_fn_ptr<T...>) {} |
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
from htmldom import htmldom | |
import string | |
import re | |
import sys | |
import queue | |
def get_pkg_name(pkg_url): | |
return pkg_name_regex.search(pkg_url).group(1) | |
def fetch_with_deps(): |
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
#include <iostream> | |
int main() { | |
std::cout << 180u - 360 << std::endl; | |
} |