Created
          December 9, 2013 13:41 
        
      - 
      
- 
        Save vittorioromeo/7872397 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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
    
  
  
    
  | namespace Internal | |
| { | |
| template<typename T> struct IsContainerHelper | |
| { | |
| template<typename U, | |
| typename Require1 = decltype(std::begin(std::declval<const U&>())), | |
| typename Require2 = decltype(std::end(std::declval<const U&>()))> | |
| static std::true_type test(const U*); | |
| template<typename U> static std::false_type test(...); | |
| using Type = decltype(test<T>(0)); | |
| const std::integral_constant<bool, Type::value> value; | |
| }; | |
| } | |
| template<typename T> using IsContainer = typename Internal::IsContainerHelper<T>::Type; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment