MPL11
All Classes Namespaces Files Typedefs Macros Groups Pages
strict_constexpr_array.hpp
Go to the documentation of this file.
1 
12 #ifndef BOOST_MPL11_DETAIL_LOGICAL_OR_STRICT_CONSTEXPR_ARRAY_HPP
13 #define BOOST_MPL11_DETAIL_LOGICAL_OR_STRICT_CONSTEXPR_ARRAY_HPP
14 
15 #include <boost/mpl11/bool.hpp>
17 
18 
19 namespace boost { namespace mpl11 { namespace detail { namespace logical_or {
20  template <std_size_t N>
21  constexpr bool strict_constexpr_array_impl(const bool (&array)[N]) {
22  // Note: GCC 4.9 does not like range-based for loop in constexpr.
23  for (std_size_t i = 0; i < N; ++i)
24  if (array[i])
25  return true;
26  return false;
27  }
28 
34  template <typename ...xs>
35  using strict_constexpr_array = bool_<
36  strict_constexpr_array_impl<sizeof...(xs)+1>({
37  (bool)xs::type::value..., false
38  })
39  >;
40 }}}} // end namespace boost::mpl11::detail::logical_or
41 
42 #endif // !BOOST_MPL11_DETAIL_LOGICAL_OR_STRICT_CONSTEXPR_ARRAY_HPP
Defines boost::mpl11::detail::std_size_t.
Forwards to boost/mpl11/integer.hpp.