static bool const has_attribute = false;
typedef unused_type attribute_type;
- binary_lit_parser(V n_)
+ constexpr binary_lit_parser(V n_)
: n(n_) {}
template <typename Iterator, typename Context, typename Attribute>
{
x3::skip_over(first, last, context);
- auto bytes = reinterpret_cast<const unsigned char*>(&n);
+ unsigned char const* bytes = n.data();
Iterator it = first;
for (unsigned int i = 0; i < sizeof(n); ++i)
}
template <typename V>
- binary_lit_parser< V, T, endian, bits> operator()(V n) const
+ constexpr binary_lit_parser< V, T, endian, bits> operator()(V n) const
{
return {n};
}
#define BOOST_SPIRIT_MAKE_BINARY_PRIMITIVE(name, endiantype, attrtype, bits) \
typedef any_binary_parser< attrtype, boost::endian::order::endiantype, bits > name##type; \
- name##type const name = name##type();
+ constexpr name##type name = name##type();
BOOST_SPIRIT_MAKE_BINARY_PRIMITIVE(byte_, native, uint_least8_t, 8)
BOOST_SPIRIT_MAKE_BINARY_PRIMITIVE(little_qword, little, uint_least64_t, 64)
#endif
- // Use a pseudo configuration macro to make clear that endian libray support
+ // Use a pseudo configuration macro to make clear that endian library support
// for floating point types is required. Must be removed as soon as the endian library
// properly supports floating point types.
#ifdef BOOST_ENDIAN_HAS_FLOATING_POINT