Skip to content

Instantly share code, notes, and snippets.

View finlaybob's full-sized avatar

Neil Finlay finlaybob

  • Edinburgh, Scotland
View GitHub Profile
#pragma once
#ifndef SHIFTERS_H
#define SHIFTERS_H
/**
* This work is licensed under a Creative Commons,
* Attribution-NonCommercial-ShareAlike 3.0 Unported License.
* http://creativecommons.org/licenses/by-nc-sa/3.0/
*
* You may copy, tweak, and build upon this work non-commercially
* as long as 1. The author is credited and 2. You license the modified
@finlaybob
finlaybob / Shifters.hpp
Created August 11, 2012 17:55
Shifters. Because I hate the word "tween"
#pragma once
#ifndef SHIFTERS_H
#define SHIFTERS_H
/**
* This work is licensed under a Creative Commons,
* Attribution-NonCommercial-ShareAlike 3.0 Unported License.
* http://creativecommons.org/licenses/by-nc-sa/3.0/
*
* You may copy, tweak, and build upon this work non-commercially
* as long as 1. The author is credited and 2. You license the modified
@finlaybob
finlaybob / main.cpp
Created August 5, 2012 11:50
std::function<> and lambdas
#include <map>
#include <functional>
#include <string>
#include <iostream>
using namespace std;
function<void(string,string)> func;
void actualABFunc(string a, string b){
@finlaybob
finlaybob / FuctionPointers.cpp
Last active October 8, 2015 01:48
My code from learning about function pointers.
#include <map>
#include <iostream>
#include <string>
using namespace std;
typedef void (*FuncPtr)(string,string);
typedef std::map<std::string, FuncPtr> FuncPtrMap;
void abFunc(string a,string b){