Skip to content

Instantly share code, notes, and snippets.

@dodheim
dodheim / with_mp11_rangemoves.patch
Created August 29, 2017 04:44
Boost 1.65.0 patches (including MP11 and Range move algos)
Left base folder: C:\libs\boost_1_65_0_unpatched
Right base folder: C:\libs\boost_1_65_0_dod
--- boost\algorithm\cxx14\equal.hpp 2017-08-19 09:49:39.000000000 -0700
+++ boost\algorithm\cxx14\equal.hpp 2017-08-21 15:24:58.000000000 -0700
@@ -18,12 +18,15 @@
namespace boost { namespace algorithm {
namespace detail {
template <class T1, class T2>
@dodheim
dodheim / no_mp11_rangemoves.patch
Created August 29, 2017 04:57
Boost 1.65.0 patches (excluding MP11 and Range move algos)
Left base folder: C:\libs\boost_1_65_0_unpatched
Right base folder: C:\libs\boost_1_65_0_dod
--- boost\algorithm\cxx14\equal.hpp 2017-08-19 09:49:39.000000000 -0700
+++ boost\algorithm\cxx14\equal.hpp 2017-08-21 15:24:58.000000000 -0700
@@ -18,12 +18,15 @@
namespace boost { namespace algorithm {
namespace detail {
template <class T1, class T2>
@dodheim
dodheim / challenge_317_easy.cpp
Last active October 5, 2017 20:49
C++17 solution for /r/dailyprogrammer challenge #317 [easy]
#include <cstdint>
#include <type_traits>
#include <string_view>
#include <string>
#include <range/v3/core.hpp>
#include <boost/hana/core/is_a.hpp>
#include <boost/hana/functional/compose.hpp>
#include <boost/hana/functional/partial.hpp>
#include <boost/hana/at.hpp>
#include <boost/hana/at_key.hpp>
@dodheim
dodheim / nice_reddit.user.js
Last active November 26, 2017 14:55 — forked from prahladyeri/nice_reddit.user.js
A Firefox user script to mark unread Reddit comments in blue background
// ==UserScript==
// @name Nice Reddit
// @namespace com.prahladyeri.userscripts.nice_reddit
// @creator [email protected]
// @description Beautify your Reddit!
// @homepage http://www.prahladyeri.com
// @include http://*.reddit.com/*
// @include https://*.reddit.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version 1.2
@dodheim
dodheim / is_constexpr_copyable.cpp
Last active March 29, 2018 14:27
is_constexpr_copyable [C++17] (candidate for https://stackoverflow.com/q/43120539)
#include <type_traits>
template<typename T, bool = std::is_default_constructible_v<T> && !std::is_array_v<T>>
struct constexpr_instance;
template<typename T>
struct constexpr_instance<T, true> {
constexpr T operator ()() const { return {}; }
};
namespace detail {
@dodheim
dodheim / challenge_335_easy.cpp
Created May 15, 2018 15:12
C++17 solution for /r/dailyprogrammer challenge #335 [easy]
#include <cstdint>
#include <cstdlib>
#include <type_traits>
#include <utility>
#include <memory>
#include <range/v3/core.hpp>
#include <range/v3/span.hpp>
#include <range/v3/action/insert.hpp>
#include <range/v3/numeric/accumulate.hpp>
#include <range/v3/utility/functional.hpp>