Skip to content

Instantly share code, notes, and snippets.

View tamaroth's full-sized avatar
♟️

tamaroth tamaroth

♟️
View GitHub Profile
@tamaroth
tamaroth / iterable_type_trait.h
Created September 10, 2018 14:19
Is type iterable trait.
namespace detail {
template<typename T>
auto is_iterable_impl(int) -> decltype(
std::begin(std::declval<T&>()) != std::end(std::declval<T&>()),
++std::declval<decltype(std::begin(std::declval<T&>()))&>(),
void(*std::begin(std::declval<T&>())),
std::true_type{}
);