Skip to content

Instantly share code, notes, and snippets.

@vinniefalco
Created November 18, 2019 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinniefalco/21763949057ae523e84845e0e74ddd4a to your computer and use it in GitHub Desktop.
Save vinniefalco/21763949057ae523e84845e0e74ddd4a to your computer and use it in GitHub Desktop.
template<class T, class = void>
struct is_storage : std::false_type {};
template<class T>
struct is_storage<T, detail::void_t<decltype(
T::id,
T::need_free,
std::declval<void*&>() =
std::declval<T&>().allocate(
std::declval<std::size_t>(),
std::declval<std::size_t>()),
std::declval<T&>().deallocate(
std::declval<void*>(),
std::declval<std::size_t>(),
std::declval<std::size_t>())
) > > : std::integral_constant<bool,
std::is_integral<T::id>::value &&
std::is_convertible<T::need_free, bool>::value>
{
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment