#ifndef NALL_CONCEPT_HPP #define NALL_CONCEPT_HPP #include #include namespace nall { //unsigned count() const; template struct has_count { enum { value = false }; }; //unsigned length() const; template struct has_length { enum { value = false }; }; //unsigned size() const; template struct has_size { enum { value = false }; }; template unsigned container_size(const T& object, typename mp_enable_if>::type = 0) { return object.count(); } template unsigned container_size(const T& object, typename mp_enable_if>::type = 0) { return object.length(); } template unsigned container_size(const T& object, typename mp_enable_if>::type = 0) { return object.size(); } template unsigned container_size(const T& object, typename mp_enable_if>::type = 0) { return sizeof(T) / sizeof(typename std::remove_extent::type); } } #endif