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
/**************************************************************************** | |
* Haskell-like automatic partial functions * | |
* * | |
* Copyright © 2014 Manuel Sánchez Pérez * | |
* * | |
* This program is free software. It comes without any warranty, to * | |
* the extent permitted by applicable law. You can redistribute it * | |
* and/or modify it under the terms of the Do What The Fuck You Want * | |
* To Public License, Version 2, as published by Sam Hocevar. See * | |
* http://www.wtfpl.net/ for more details. * |
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
//Author: Manu Sánchez (Manu343726). Aug 2014 | |
//Everything started from this: http://stackoverflow.com/questions/25338795/is-there-a-name-for-this-tuple-creation-idiom | |
//Now, play with C++14! | |
#include <utility> | |
#include <iostream> | |
#include <exception> | |
template<typename... Ls> |
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
/* | |
* A simple Copy On Write (COW) string implementation. | |
* | |
* Copyright © 2014 Manu Sanchez. @Manu343726 on GitHub, Stack Overflow, etc. | |
* | |
* manu343726.github.io | |
* | |
* This program is free software. It comes without any warranty, to | |
* the extent permitted by applicable law. You can redistribute it | |
* and/or modify it under the terms of the Do What The Fuck You Want |
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 <vector> | |
#include <functional> | |
#include <experimental/optional> | |
#include <utility> | |
auto naked_tuple = [](auto... xs) | |
{ | |
return [=](auto f) |
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! |
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
// | |
// Created by manu343726 on 16/06/15. | |
// | |
#ifndef ERASED_RANGE_HPP | |
#define ERASED_RANGE_HPP | |
#include <range/v3/all.hpp> | |
#include <type_traits> |
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 "piecewise_construct.hpp" | |
struct foo | |
{ | |
foo(int i, int j) : | |
i{i}, j{j} | |
{} | |
int i = 0, j = 0; | |
}; |
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
g++ main.cpp -o ctti.s -S -O3 -Wno-unused-value -ftemplate-depth=2048 -DCTTI_MAX_STRING_LENGTH=128 |
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
clang++ -std=c++14 main.cpp -o ctti.s -O3 -S -Wno-unused-value -ftemplate-depth=2048 -DCTTI_MAX_STRING_LENGTH=128 |
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.hpp" | |
#include <iostream> | |
template<typename T> | |
std::intptr_t between(const T& lhs, const T& rhs) | |
{ | |
return reinterpret_cast<std::intptr_t>(&lhs) - reinterpret_cast<std::intptr_t>(&rhs); | |
} | |
template<typename T> |
OlderNewer