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 <windows.h> | |
#include <iostream> | |
FILE _iob[] = { *stdin, *stdout, *stderr }; | |
extern "C" FILE * __cdecl __iob_func(void) { return _iob; } | |
#include <GL/glew.h> | |
#include <GL/wglew.h> | |
#include <SDL.h> | |
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> | |
#include <string> | |
#include <mutex> | |
#include <chrono> | |
#include <list> | |
using namespace std::chrono_literals; | |
std::string panda; | |
std::mutex mt; | |
std::condition_variable cv; |
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 <tuple> | |
#include <iostream> | |
template <size_t CUR, size_t END> | |
struct ForEachIter_t { | |
template <typename CALLABLE, typename...TYPES> | |
static void Do(std::tuple<TYPES...>& tpl, CALLABLE&& func) { | |
auto& tplItem = std::get<CUR>(tpl); | |
func(tplItem); | |
ForEachIter_t<CUR + 1, END>::Do(tpl, func); |
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 <cstdio> | |
#include <cstdlib> | |
template <int P, bool d3, bool d5> | |
struct print { | |
static void Do(); | |
}; | |
template <int P> | |
struct print<P, false, false> { |
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 <fstream> | |
#include <iostream> | |
#include <map> | |
#include <vector> | |
#include <set> | |
// PREFACE | |
// Никогда не писал такие парсилки текста, как-то очень некрасиво вышло.. ;( | |
// Точно работает на MSVC2015 (по идее должно работать на MSVC2013, но не тестил) | |
// Парсит русский UTF-8, и лексикографически пытается сравнивать. |
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> | |
#include <tuple> | |
#include <vector> | |
// ========== VARIADIC | |
void PrintInternal() { | |
std::cout << std::endl; | |
} | |
// it needs to be visible |
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 <sstream> | |
#include <iostream> | |
#include <iterator> | |
#include <tuple> | |
template <typename T> | |
std::vector<std::string> Split(T&& input) { | |
std::stringstream ss{ std::forward<T>(input) }; | |
return std::vector<std::string> {std::istream_iterator<std::string>(ss), std::istream_iterator<std::string>{} }; |
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> | |
#include <vector> | |
#include <iterator> | |
#include <map> | |
#include <iostream> | |
#include <string> | |
#include <numeric> | |
template <typename T, size_t SIZE = 20> | |
class RingAllocator { |