Skip to content

Instantly share code, notes, and snippets.

@jbandela
jbandela / capturemymove1.cpp
Created December 4, 2012 21:29
Capture by Move Lambda - C++11
#include <utility>
#include <iostream>
#include <memory>
#include <type_traits>
#include <functional>
template<class T>
using moved_value = std::reference_wrapper<T>;
template<class T,class F>
@jbandela
jbandela / DigestMatcher.cpp
Created November 28, 2012 21:29
Select a template class based on a string
// For motivation see stackoverflow
// http://stackoverflow.com/questions/13612832/template-for-referencing-classes-themselves-rather-than-a-class-that-uses-templa
#include <iostream>
#include <string>
#include <typeinfo>
#include <cstring>