Skip to content

Instantly share code, notes, and snippets.

View ldionne's full-sized avatar

Louis Dionne ldionne

View GitHub Profile
@ldionne
ldionne / issaquah_2016_reflection.cpp
Created March 2, 2017 17:15
Library-based value-syntax for reflection as shown in Issaquah
//
// A demo of value-syntax reflection built on top of the current reflection proposal,
// as shown to the Reflection SG at the Issaquah meeting in 2016.
//
// Author: Louis Dionne
//
// ~/code/llvm/build/prefix/bin/clang++ -I ~/code/hana/include -isystem ~/code/llvm/build/prefix/lib/clang/4.0.0/include -I ~/code/llvm/tools/clang/reflection -Xclang -freflection -std=c++1z code/worksheet.cpp
@ldionne
ldionne / CMakeLists.txt
Created November 8, 2016 14:53
Benchmark of hana::string w/ c_str() method
# Copyright Louis Dionne 2016
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
set(datasets)
add_dataset(datasets hetero make hana string1 hana.string.cpp.erb 4 "(0..50).step(10).to_a + (100..300).step(50).to_a" "which\;1")
add_dataset(datasets hetero make hana string2 hana.string.cpp.erb 4 "(0..50).step(10).to_a + (100..300).step(50).to_a" "which\;2")
add_chart(hetero make DATASETS ${datasets})
@ldionne
ldionne / P0107.diff
Created June 8, 2016 02:17
Patch to implement P0107 in libc++
commit 4d6f53adf9ddb41ae6b477a39b8b609159c74cf2
Author: Louis Dionne <ldionne.2@gmail.com>
Date: Tue May 24 15:36:02 2016 -0700
[array] Implement P0107 improving the support for constexpr in std::array
diff --git a/include/array b/include/array
index 719286d..28d093d 100644
--- a/include/array
+++ b/include/array
@ldionne
ldionne / .gitignore
Last active May 11, 2016 14:47
Exploring code generation with large structs and arrays
build/
@ldionne
ldionne / CMakeLists.txt
Last active April 30, 2016 23:18
Benchmarking compilation time w.r.t. symbol lengths generated by expression templates
# Copyright Louis Dionne 2016
# Distributed under the Boost Software License, Version 1.0.
cmake_minimum_required(VERSION 3.2)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
include(metabench)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ldionne
ldionne / CMakeLists.txt
Last active April 30, 2016 16:41
Benchmarking different patterns of overload resolution
# Copyright Louis Dionne 2016
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
include(metabench)
@ldionne
ldionne / .gitignore
Last active April 20, 2016 21:32
Benchmarking the compile-time of multi-visitation on variants
build/
@ldionne
ldionne / metabench-index.html
Created April 20, 2016 16:12
Copy of Metabench's index.html file, as generated on GitHub Pages
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Metabench</title>
@ldionne
ldionne / anonymous.erb.cpp
Created February 7, 2016 18:35
Benchmark of different compile-time string representations
// Copyright Louis Dionne 2013-2016
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
template <char ...s>
static auto string_maker = [] {
struct local { char data[sizeof...(s)] = {s...}; };
return local{};
};
@ldionne
ldionne / lazy_and.cpp
Last active January 18, 2016 23:21
Implementation of a lazy conjunction based on SFINAE (see DR 1227: http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1227)
// Note: This original idea was shown to me by Eric Fiselier. All credits where due.
#include <type_traits>
template <typename Condition, typename T = void>
struct enable_if
: std::enable_if<Condition::value, T>
{ };