Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am thenickdude on github.
  • I am thenickdude (https://keybase.io/thenickdude) on keybase.
  • I have a public key ASDW7Os9BuMp_IgJK8boOMYci3plhe16mWnYlQEn-hx7aQo

To claim this, I am signing this object:

@thenickdude
thenickdude / sfinae.cpp
Created February 22, 2016 10:27
C++ SFINAE: Call a 2 argument constructor if it exists for a templated type, otherwise call the no-arg constructor
#include <iostream>
#include <type_traits>
#include <cstdint>
#include <cstddef>
// Or we can use enable_if from Boost:
template <bool, typename T = void>
struct enable_if {
};