]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/spirit/home/x3/binary/binary.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / spirit / home / x3 / binary / binary.hpp
index 4c187f420097a9655bf94812f7ae402ec5c0aea5..12caf3bbaf78e8ca568e52b654c5635cffb3554d 100644 (file)
@@ -31,7 +31,7 @@ namespace boost { namespace spirit { namespace x3
         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>
@@ -40,7 +40,7 @@ namespace boost { namespace spirit { namespace x3
         {
             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)
@@ -91,7 +91,7 @@ namespace boost { namespace spirit { namespace x3
         }
 
         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};
         }
@@ -99,7 +99,7 @@ namespace boost { namespace spirit { namespace x3
 
 #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)
@@ -115,7 +115,7 @@ namespace boost { namespace spirit { namespace x3
     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