Skip to content

Instantly share code, notes, and snippets.

@EricWF
Created January 22, 2016 01:54
Show Gist options
  • Select an option

  • Save EricWF/9f3f0e256718b9a7314f to your computer and use it in GitHub Desktop.

Select an option

Save EricWF/9f3f0e256718b9a7314f to your computer and use it in GitHub Desktop.
#include <type_traits>
struct __dummy_type {};
template <class _Tp> _Tp& __test(int);
template <class _Tp> __dummy_type __test(...);
template <class _Tp>
struct __is_referenceable : std::integral_constant<bool,
!std::is_same<decltype(__test<_Tp>(0)), __dummy_type>::value
> {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment