17 #ifndef CONTAINER_SIZE_H_INCLUDED
18 #define CONTAINER_SIZE_H_INCLUDED
20 #include <Pb/meta_fwd.h>
21 #include <Pb/length.h>
35 template <
typename T >
40 template <
typename U >
42 static no_t selector(...);
46 static const bool value =
47 sizeof(selector(*this_t())) !=
sizeof(
no_t);
52 template <typename T, bool use_format_type = has_format_type<T>::value>
53 struct ContainerSize_Impl
54 : std::integral_constant< size_t,
55 OffsetOf< Hg::length<T>::value, T>::value
60 struct ContainerSize_Impl<T, true>
61 : std::integral_constant< size_t,
62 OffsetOf< Hg::length< typename T::format_type>::value,
63 typename T::format_type
78 template <
typename ContainerT>
80 :
type_check<type_container<ContainerT>::value>
81 , detail::ContainerSize_Impl< ContainerT>