Skip to content

Instantly share code, notes, and snippets.

View simmplecoder's full-sized avatar

Olzhas Zhumabek simmplecoder

View GitHub Profile
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
@simmplecoder
simmplecoder / CMakeLists.txt
Created July 21, 2017 11:49
async accumulate code
cmake_minimum_required(VERSION 3.8)
project(untitled)
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES main.cpp)
add_executable(untitled ${SOURCE_FILES})
target_link_libraries(untitled pthread)
@simmplecoder
simmplecoder / bash-colors.md
Created May 18, 2017 15:37 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple

std::call

The purpose of std::call is to enable std::apply on non tuple arguments, and make it viable even for multi argument cases.

Current situation:

Lets consider some usage cases:

//first example
template <typename ... Types>
void process_instance(std::size_t id, Types&amp;&amp; ... args);
#include <cstddef>
#include <type_traits>
#include <cstring>
namespace playground
{
template<typename T>
struct count_indirections
{
static constexpr std::size_t value = 0;
#define EPSILON 0.001
#include <utility>
#include <bitset>
#include <cassert>
#include <iostream>
template <std::size_t dimensions>
using quadrant = std::bitset<dimensions>;
template <typename T>
#include <string>
#include <fstream>
#include <vector>
#include <utility>
#include <cctype>
#include <iterator>
struct parse_result
{
std::vector<std::string> text;
@simmplecoder
simmplecoder / typelist.h
Last active October 10, 2016 18:43
The header file provides useful type list manipulation function objects
#ifndef TYPELIST_H
#define TYPELIST_H
#include <utility>
#include <cassert>
#include <cstddef>
#include <tuple>
template <class ... Types>
class type_list {};
#pragma once
#include <numeric>
namespace impl_details
{
template <typename T, typename UnaryAdvanceOp>
class proxy
{
T value;
#pragma once
#include <vector>
template<typename T>
struct SimpleDestructableTrivialy
{
static constexpr bool value = std::is_trivially_destructible<T>::value;
};
template<typename T, bool = SimpleDestructableTrivialy<T>::value>
class SimpleDestroy