Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / multiprecision / logged_adaptor.hpp
index 014a117..caa9c77 100644 (file)
@@ -9,8 +9,8 @@
 #include <boost/multiprecision/traits/extract_exponent_type.hpp>
 #include <boost/multiprecision/detail/integer_ops.hpp>
 
-namespace boost{
-namespace multiprecision{
+namespace boost {
+namespace multiprecision {
 
 template <class Backend>
 inline void log_postfix_event(const Backend&, const char* /*event_description*/)
@@ -37,21 +37,21 @@ inline void log_prefix_event(const Backend&, const T&, const U&, const V&, const
 {
 }
 
-namespace backends{
+namespace backends {
 
 template <class Backend>
 struct logged_adaptor
 {
-   typedef typename Backend::signed_types              signed_types;
-   typedef typename Backend::unsigned_types            unsigned_types;
-   typedef typename Backend::float_types               float_types;
+   typedef typename Backend::signed_types   signed_types;
+   typedef typename Backend::unsigned_types unsigned_types;
+   typedef typename Backend::float_types    float_types;
    typedef typename extract_exponent_type<
-      Backend, number_category<Backend>::value>::type  exponent_type;
-
-private:
+       Backend, number_category<Backend>::value>::type exponent_type;
 
+ private:
    Backend m_value;
-public:
+
+ public:
    logged_adaptor()
    {
       log_postfix_event(m_value, "Default construct");
@@ -62,14 +62,14 @@ public:
       m_value = o.m_value;
       log_postfix_event(m_value, "Copy construct");
    }
-#ifndef BOOST_NO_RVALUE_REFERENCES
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
    logged_adaptor(logged_adaptor&& o)
    {
       log_prefix_event(m_value, o.value(), "Move construct");
       m_value = static_cast<Backend&&>(o.m_value);
       log_postfix_event(m_value, "Move construct");
    }
-   logged_adaptor& operator = (logged_adaptor&& o)
+   logged_adaptor& operator=(logged_adaptor&& o)
    {
       log_prefix_event(m_value, o.value(), "Move Assignment");
       m_value = static_cast<Backend&&>(o.m_value);
@@ -77,7 +77,7 @@ public:
       return *this;
    }
 #endif
-   logged_adaptor& operator = (const logged_adaptor& o)
+   logged_adaptor& operator=(const logged_adaptor& o)
    {
       log_prefix_event(m_value, o.value(), "Assignment");
       m_value = o.m_value;
@@ -86,25 +86,25 @@ public:
    }
    template <class T>
    logged_adaptor(const T& i, const typename enable_if_c<is_convertible<T, Backend>::value>::type* = 0)
-      : m_value(i)
+       : m_value(i)
    {
       log_postfix_event(m_value, "construct from arithmetic type");
    }
    template <class T>
    logged_adaptor(const logged_adaptor<T>& i, const typename enable_if_c<is_convertible<T, Backend>::value>::type* = 0)
-      : m_value(i.value())
+       : m_value(i.value())
    {
       log_postfix_event(m_value, "construct from arithmetic type");
    }
    template <class T>
-   typename enable_if_c<is_arithmetic<T>::value || is_convertible<T, Backend>::value, logged_adaptor&>::type operator = (const T& i)
+   typename enable_if_c<is_arithmetic<T>::value || is_convertible<T, Backend>::value, logged_adaptor&>::type operator=(const T& i)
    {
       log_prefix_event(m_value, i, "Assignment from arithmetic type");
       m_value = i;
       log_postfix_event(m_value, "Assignment from arithmetic type");
       return *this;
    }
-   logged_adaptor& operator = (const char* s)
+   logged_adaptor& operator=(const char* s)
    {
       log_prefix_event(m_value, s, "Assignment from string type");
       m_value = s;
@@ -117,7 +117,7 @@ public:
       std::swap(m_value, o.value());
       log_postfix_event(m_value, "swap");
    }
-   std::string str(std::streamsize digits, std::ios_base::fmtflags f)const
+   std::string str(std::streamsize digits, std::ios_base::fmtflags f) const
    {
       log_prefix_event(m_value, "Conversion to string");
       std::string s = m_value.str(digits, f);
@@ -130,7 +130,7 @@ public:
       m_value.negate();
       log_postfix_event(m_value, "negate");
    }
-   int compare(const logged_adaptor& o)const
+   int compare(const logged_adaptor& o) const
    {
       log_prefix_event(m_value, o.value(), "compare");
       int r = m_value.compare(o.value());
@@ -138,7 +138,7 @@ public:
       return r;
    }
    template <class T>
-   int compare(const T& i)const
+   int compare(const T& i) const
    {
       log_prefix_event(m_value, i, "compare");
       int r = m_value.compare(i);
@@ -149,7 +149,7 @@ public:
    {
       return m_value;
    }
-   const Backend& value()const
+   const Backend& value() const
    {
       return m_value;
    }
@@ -157,7 +157,7 @@ public:
    void serialize(Archive& ar, const unsigned int /*version*/)
    {
       log_prefix_event(m_value, "serialize");
-      ar & boost::serialization::make_nvp("value", m_value);
+      ar& boost::make_nvp("value", m_value);
       log_postfix_event(m_value, "serialize");
    }
    static unsigned default_precision() BOOST_NOEXCEPT
@@ -168,7 +168,7 @@ public:
    {
       Backend::default_precision(v);
    }
-   unsigned precision()const BOOST_NOEXCEPT
+   unsigned precision() const BOOST_NOEXCEPT
    {
       return value().precision();
    }
@@ -183,117 +183,130 @@ inline const T& unwrap_logged_type(const T& a) { return a; }
 template <class Backend>
 inline const Backend& unwrap_logged_type(const logged_adaptor<Backend>& a) { return a.value(); }
 
-#define NON_MEMBER_OP1(name, str) \
-   template <class Backend>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), str);\
-      BOOST_JOIN(eval_, name)(result.value());\
-      log_postfix_event(result.value(), str);\
+#define NON_MEMBER_OP1(name, str)                                        \
+   template <class Backend>                                              \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result) \
+   {                                                                     \
+      using default_ops::BOOST_JOIN(eval_, name);                        \
+      log_prefix_event(result.value(), str);                             \
+      BOOST_JOIN(eval_, name)                                            \
+      (result.value());                                                  \
+      log_postfix_event(result.value(), str);                            \
    }
 
-#define NON_MEMBER_OP2(name, str) \
-   template <class Backend, class T>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const T& a)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const logged_adaptor<Backend>& a)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a));\
-      log_postfix_event(result.value(), str);\
+#define NON_MEMBER_OP2(name, str)                                                                          \
+   template <class Backend, class T>                                                                       \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const T& a)                       \
+   {                                                                                                       \
+      using default_ops::BOOST_JOIN(eval_, name);                                                          \
+      log_prefix_event(result.value(), unwrap_logged_type(a), str);                                        \
+      BOOST_JOIN(eval_, name)                                                                              \
+      (result.value(), unwrap_logged_type(a));                                                             \
+      log_postfix_event(result.value(), str);                                                              \
+   }                                                                                                       \
+   template <class Backend>                                                                                \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const logged_adaptor<Backend>& a) \
+   {                                                                                                       \
+      using default_ops::BOOST_JOIN(eval_, name);                                                          \
+      log_prefix_event(result.value(), unwrap_logged_type(a), str);                                        \
+      BOOST_JOIN(eval_, name)                                                                              \
+      (result.value(), unwrap_logged_type(a));                                                             \
+      log_postfix_event(result.value(), str);                                                              \
    }
 
-#define NON_MEMBER_OP3(name, str) \
-   template <class Backend, class T, class U>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const T& a, const U& b)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend, class T>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const logged_adaptor<Backend>& a, const T& b)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend, class T>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const T& a, const logged_adaptor<Backend>& b)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const logged_adaptor<Backend>& a, const logged_adaptor<Backend>& b)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b));\
-      log_postfix_event(result.value(), str);\
+#define NON_MEMBER_OP3(name, str)                                                                                                            \
+   template <class Backend, class T, class U>                                                                                                \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const T& a, const U& b)                                             \
+   {                                                                                                                                         \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                            \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), str);                                                   \
+      BOOST_JOIN(eval_, name)                                                                                                                \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b));                                                                        \
+      log_postfix_event(result.value(), str);                                                                                                \
+   }                                                                                                                                         \
+   template <class Backend, class T>                                                                                                         \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const logged_adaptor<Backend>& a, const T& b)                       \
+   {                                                                                                                                         \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                            \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), str);                                                   \
+      BOOST_JOIN(eval_, name)                                                                                                                \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b));                                                                        \
+      log_postfix_event(result.value(), str);                                                                                                \
+   }                                                                                                                                         \
+   template <class Backend, class T>                                                                                                         \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const T& a, const logged_adaptor<Backend>& b)                       \
+   {                                                                                                                                         \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                            \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), str);                                                   \
+      BOOST_JOIN(eval_, name)                                                                                                                \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b));                                                                        \
+      log_postfix_event(result.value(), str);                                                                                                \
+   }                                                                                                                                         \
+   template <class Backend>                                                                                                                  \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const logged_adaptor<Backend>& a, const logged_adaptor<Backend>& b) \
+   {                                                                                                                                         \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                            \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), str);                                                   \
+      BOOST_JOIN(eval_, name)                                                                                                                \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b));                                                                        \
+      log_postfix_event(result.value(), str);                                                                                                \
    }
 
-#define NON_MEMBER_OP4(name, str) \
-   template <class Backend, class T, class U, class V>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const T& a, const U& b, const V& c)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend, class T>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const logged_adaptor<Backend>& a, const logged_adaptor<Backend>& b, const T& c)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend, class T>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const logged_adaptor<Backend>& a, const T& b, const logged_adaptor<Backend>& c)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend, class T>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const T& a, const logged_adaptor<Backend>& b, const logged_adaptor<Backend>& c)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const logged_adaptor<Backend>& a, const logged_adaptor<Backend>& b, const logged_adaptor<Backend>& c)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class Backend, class T, class U>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend>& result, const logged_adaptor<Backend>& a, const T& b, const U& c)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);\
-      BOOST_JOIN(eval_, name)(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));\
-      log_postfix_event(result.value(), str);\
-   }\
+#define NON_MEMBER_OP4(name, str)                                                                                                                                              \
+   template <class Backend, class T, class U, class V>                                                                                                                         \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const T& a, const U& b, const V& c)                                                                   \
+   {                                                                                                                                                                           \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                                                              \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);                                                              \
+      BOOST_JOIN(eval_, name)                                                                                                                                                  \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));                                                                                   \
+      log_postfix_event(result.value(), str);                                                                                                                                  \
+   }                                                                                                                                                                           \
+   template <class Backend, class T>                                                                                                                                           \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const logged_adaptor<Backend>& a, const logged_adaptor<Backend>& b, const T& c)                       \
+   {                                                                                                                                                                           \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                                                              \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);                                                              \
+      BOOST_JOIN(eval_, name)                                                                                                                                                  \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));                                                                                   \
+      log_postfix_event(result.value(), str);                                                                                                                                  \
+   }                                                                                                                                                                           \
+   template <class Backend, class T>                                                                                                                                           \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const logged_adaptor<Backend>& a, const T& b, const logged_adaptor<Backend>& c)                       \
+   {                                                                                                                                                                           \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                                                              \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);                                                              \
+      BOOST_JOIN(eval_, name)                                                                                                                                                  \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));                                                                                   \
+      log_postfix_event(result.value(), str);                                                                                                                                  \
+   }                                                                                                                                                                           \
+   template <class Backend, class T>                                                                                                                                           \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const T& a, const logged_adaptor<Backend>& b, const logged_adaptor<Backend>& c)                       \
+   {                                                                                                                                                                           \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                                                              \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);                                                              \
+      BOOST_JOIN(eval_, name)                                                                                                                                                  \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));                                                                                   \
+      log_postfix_event(result.value(), str);                                                                                                                                  \
+   }                                                                                                                                                                           \
+   template <class Backend>                                                                                                                                                    \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const logged_adaptor<Backend>& a, const logged_adaptor<Backend>& b, const logged_adaptor<Backend>& c) \
+   {                                                                                                                                                                           \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                                                              \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);                                                              \
+      BOOST_JOIN(eval_, name)                                                                                                                                                  \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));                                                                                   \
+      log_postfix_event(result.value(), str);                                                                                                                                  \
+   }                                                                                                                                                                           \
+   template <class Backend, class T, class U>                                                                                                                                  \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<Backend> & result, const logged_adaptor<Backend>& a, const T& b, const U& c)                                             \
+   {                                                                                                                                                                           \
+      using default_ops::BOOST_JOIN(eval_, name);                                                                                                                              \
+      log_prefix_event(result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c), str);                                                              \
+      BOOST_JOIN(eval_, name)                                                                                                                                                  \
+      (result.value(), unwrap_logged_type(a), unwrap_logged_type(b), unwrap_logged_type(c));                                                                                   \
+      log_postfix_event(result.value(), str);                                                                                                                                  \
+   }
 
 NON_MEMBER_OP2(add, "+=")
 NON_MEMBER_OP2(subtract, "-=")
@@ -540,22 +553,24 @@ std::size_t hash_value(const logged_adaptor<Backend>& val)
    return hash_value(val.value());
 }
 
-#define NON_MEMBER_COMPLEX_TO_REAL(name, str) \
-   template <class B1, class B2>\
-   inline void BOOST_JOIN(eval_, name)(logged_adaptor<B1>& result, const logged_adaptor<B2>& a)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(a.value(), a.value(), str);\
-      BOOST_JOIN(eval_, name)(result.value(), a.value());\
-      log_postfix_event(result.value(), str);\
-   }\
-   template <class B1, class B2>\
-   inline void BOOST_JOIN(eval_, name)(B1& result, const logged_adaptor<B2>& a)\
-   {\
-      using default_ops::BOOST_JOIN(eval_, name);\
-      log_prefix_event(a.value(), a.value(), str);\
-      BOOST_JOIN(eval_, name)(result, a.value());\
-      log_postfix_event(result, str);\
+#define NON_MEMBER_COMPLEX_TO_REAL(name, str)                                                    \
+   template <class B1, class B2>                                                                 \
+   inline void BOOST_JOIN(eval_, name)(logged_adaptor<B1> & result, const logged_adaptor<B2>& a) \
+   {                                                                                             \
+      using default_ops::BOOST_JOIN(eval_, name);                                                \
+      log_prefix_event(a.value(), a.value(), str);                                               \
+      BOOST_JOIN(eval_, name)                                                                    \
+      (result.value(), a.value());                                                               \
+      log_postfix_event(result.value(), str);                                                    \
+   }                                                                                             \
+   template <class B1, class B2>                                                                 \
+   inline void BOOST_JOIN(eval_, name)(B1 & result, const logged_adaptor<B2>& a)                 \
+   {                                                                                             \
+      using default_ops::BOOST_JOIN(eval_, name);                                                \
+      log_prefix_event(a.value(), a.value(), str);                                               \
+      BOOST_JOIN(eval_, name)                                                                    \
+      (result, a.value());                                                                       \
+      log_postfix_event(result, str);                                                            \
    }
 
 NON_MEMBER_COMPLEX_TO_REAL(real, "real")
@@ -567,28 +582,28 @@ inline void assign_components(logged_adaptor<T>& result, const V& v1, const U& v
    assign_components(result.value(), v1, v2);
 }
 
-
-
 } // namespace backends
 
 using backends::logged_adaptor;
 
-template<class Backend>
-struct number_category<backends::logged_adaptor<Backend> > : public number_category<Backend> {};
+template <class Backend>
+struct number_category<backends::logged_adaptor<Backend> > : public number_category<Backend>
+{};
 
-}} // namespaces
+}} // namespace boost::multiprecision
 
-namespace std{
+namespace std {
 
 template <class Backend, boost::multiprecision::expression_template_option ExpressionTemplates>
 class numeric_limits<boost::multiprecision::number<boost::multiprecision::backends::logged_adaptor<Backend>, ExpressionTemplates> >
-   : public std::numeric_limits<boost::multiprecision::number<Backend, ExpressionTemplates> >
+    : public std::numeric_limits<boost::multiprecision::number<Backend, ExpressionTemplates> >
 {
-   typedef std::numeric_limits<boost::multiprecision::number<Backend, ExpressionTemplates> > base_type;
+   typedef std::numeric_limits<boost::multiprecision::number<Backend, ExpressionTemplates> >                            base_type;
    typedef boost::multiprecision::number<boost::multiprecision::backends::logged_adaptor<Backend>, ExpressionTemplates> number_type;
-public:
-   static number_type (min)() BOOST_NOEXCEPT { return (base_type::min)(); }
-   static number_type (max)() BOOST_NOEXCEPT { return (base_type::max)(); }
+
+ public:
+   static number_type(min)() BOOST_NOEXCEPT { return (base_type::min)(); }
+   static number_type(max)() BOOST_NOEXCEPT { return (base_type::max)(); }
    static number_type lowest() BOOST_NOEXCEPT { return -(max)(); }
    static number_type epsilon() BOOST_NOEXCEPT { return base_type::epsilon(); }
    static number_type round_error() BOOST_NOEXCEPT { return epsilon() / 2; }
@@ -600,18 +615,19 @@ public:
 
 } // namespace std
 
-namespace boost{ namespace math{
+namespace boost {
+namespace math {
 
-namespace policies{
+namespace policies {
 
 template <class Backend, boost::multiprecision::expression_template_option ExpressionTemplates, class Policy>
-struct precision< boost::multiprecision::number<boost::multiprecision::logged_adaptor<Backend>, ExpressionTemplates>, Policy>
-   : public precision<boost::multiprecision::number<Backend, ExpressionTemplates>, Policy>
+struct precision<boost::multiprecision::number<boost::multiprecision::logged_adaptor<Backend>, ExpressionTemplates>, Policy>
+    : public precision<boost::multiprecision::number<Backend, ExpressionTemplates>, Policy>
 {};
 
-} // namespace policies
+}
 
-}} // namespaces boost::math
+}} // namespace boost::math::policies
 
 #undef NON_MEMBER_OP1
 #undef NON_MEMBER_OP2