Skip to content

Instantly share code, notes, and snippets.

David Zmick dpzmick

Block or report user

Report or block dpzmick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:34fbd37cf4e9b0252c0453cb4cc63204
1985,130
1986,141
1987,147
1988,162
1989,159
1990,176
1991,137
1992,122
1993,148
1994,148
@dpzmick
dpzmick / topsort.cpp
Last active Oct 6, 2017
fragile topological sort in c++ templates
View topsort.cpp
#include <cstddef>
#include <iostream>
#include <sstream>
#include <type_traits>
struct nil { };
template <typename H, class T>
struct cons
{
View views.cpp
#include <cstddef>
#include <iostream>
#include <type_traits>
struct nil { };
template <typename H, class T>
struct cons
{
using head = H;
View apply.cpp
#include <tuple>
#include <iostream>
class LoudCopy
{
public:
LoudCopy() { }
LoudCopy(const LoudCopy&) = delete;
LoudCopy(LoudCopy&&) {}
};
View test.cpp
#include "benchmark/benchmark.h"
#include <cstdlib>
#include <random>
#define LIMIT 5*1024*1024
enum class Variant { eA, eB };
struct Wrapper {
View rt_annotations.cpp
#include "typestring.hh"
#include <memory>
#include <thread>
#include <type_traits>
#include <iostream>
// by default nothing is realtime
template <typename T>
struct RTSaftey
View rt_annotations.cpp
#include "typestring.hh"
#include <memory>
#include <thread>
#include <type_traits>
#include <iostream>
// by default nothing is realtime
template <typename T>
struct RTSaftey
View main.rs
#[macro_use]
extern crate conrod;
use conrod::Borderable;
use conrod::Positionable;
use conrod::Widget;
use conrod::backend::glium::glium::DisplayBuild;
use conrod::backend::glium::glium::Surface;
use conrod::backend::glium::glium;
use conrod::glium::backend::glutin_backend::GlutinFacade;
View rust_img_postopt_blog.ll
; ModuleID = './core.bc'
source_filename = "src/core.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.image = type { i8*, i64, i64 }
; Function Attrs: alwaysinline norecurse nounwind readnone uwtable
define i8* @at(i8* readnone, i64, i64, i64) local_unnamed_addr #0 {
%5 = mul nsw i64 %3, %1
View rust_img_preopt_blog.ll
; ModuleID = './core.bc'
source_filename = "src/core.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.image = type { i8*, i64, i64 }
; Function Attrs: alwaysinline nounwind uwtable
define i8* @at(i8*, i64, i64, i64) #0 {
%5 = alloca i8*, align 8
You can’t perform that action at this time.