Created
August 8, 2015 21:59
-
-
Save simonlynen/b29750e69e6629ddcfd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
struct HasConstIterator { | |
private: | |
typedef char Yes; | |
typedef struct { | |
char array[2]; | |
} No; | |
template<typename C> static Yes Test(typename C::const_iterator*); | |
template<typename C> static No Test(...); | |
public: | |
static const bool value = sizeof(Test<T>(0)) == sizeof(Yes); | |
typedef T type; | |
}; | |
template<typename T> | |
struct IsContainer : std::integral_constant<bool, HasConstIterator<T>::value> { | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment