Skip to content

Instantly share code, notes, and snippets.

@Fuyutsubaki
Fuyutsubaki / fuse_cast.hpp
Created February 20, 2014 10:30
[std::function<R(Args...)>] → [std::function<R(std::tuple<Args...>)]
#include<functional>
#include<tuple>
namespace tupleple
{
namespace deteil{
template<size_t ...R>
struct size_t_List{};
template<size_t N>
@Fuyutsubaki
Fuyutsubaki / gist:6803bd43553db89d0d32
Created May 10, 2014 04:20
無名構造体もどき
#include<iostream>
#include<string>
namespace iod
{
template<class...>
struct iod_tuple{};
@Fuyutsubaki
Fuyutsubaki / PPL.hpp
Last active August 29, 2015 14:01
PARAMETER_PACK helper
#ifndef PARAMETER_PACK_LIBRARY_HPP_140521
#define PARAMETER_PACK_LIBRARY_HPP_140521
#include<type_traits>
#include<tuple>
namespace ppl
{
namespace deteil
{
template<size_t ...Idxs>
struct List{};
#include<utility>
#include<type_traits>
#include<tupleple\utility\index_tuple.hpp>
#include<typeinfo>
#include<iostream>
namespace tupleple
{
template<class>struct seq_to_tuple;
template<size_t...N>
struct seq_to_tuple<index::Sequence<N...>>
@Fuyutsubaki
Fuyutsubaki / my_test_ib.hpp
Created June 5, 2014 01:12
マクロ無しの健全なテストライブラリ
#pragma once
#include<functional>
#include<list>
namespace test
{
struct Test
{
public:
using call_back = std::function<void()>;
@Fuyutsubaki
Fuyutsubaki / binary_fold.hpp
Created June 10, 2014 15:20
constexpr binary fold
#include<utility>
#include<sprout/functional.hpp>
#include <sprout/utility.hpp>
namespace deteil
{
template<std::size_t begin, std::size_t length>
struct binary_fold_impl
{
using lhs = binary_fold_impl<begin, length / 2>;
using rhs = binary_fold_impl<begin + length / 2, length - length / 2>;
template<class...Types>
struct variant;
namespace deteil
{
template<class T>
struct is_variant
:std::false_type
{};
template<class ...T>
@Fuyutsubaki
Fuyutsubaki / recurrence_iterator.hpp
Last active August 29, 2015 14:03
constexpr recurrence_iterator
#include <iterator>
#include <utility>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/iterator/next.hpp>
#include <sprout/iterator/prev.hpp>
#include<sprout/range/range_container.hpp>
template<class Value, class Func>
class recurrence_iterator
@Fuyutsubaki
Fuyutsubaki / constexpr_bitonic_sort.hpp
Created July 11, 2014 02:08
constexpr bitonic sort
#include<utility>
#include<sprout/algorithm.hpp>
#include<sprout/array.hpp>
namespace impl
{
template<class T, std::size_t N>
struct bitonic_sort_impl
{
using array = sprout::array<T, (1u << N)>;
#include <sprout/index_tuple.hpp>
#include <sprout/array.hpp>
#include<utility>
#include<type_traits>
namespace detail {
//ここからバイトニック成分
namespace impl
{
template<class T, class>struct Bitonic_Marge_impl;