]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/utility/addressof.hpp
Also display the info about BibTeX databases in the TeX info panel.
[lyx.git] / boost / boost / utility / addressof.hpp
index 8e0a586880ec53de60565f422ef6d4677aa4db2d..95cd92fca9bb940ae0f9a289268a0fe4a9305b68 100644 (file)
@@ -21,6 +21,17 @@ namespace boost
 namespace detail
 {
 
+template<class T> struct addr_impl_ref
+{
+    T & v_;
+
+    inline addr_impl_ref( T & v ): v_( v ) {}
+    inline operator T& () const { return v_; }
+
+private:
+    addr_impl_ref & operator=(const addr_impl_ref &);
+};
+
 template<class T> struct addressof_impl
 {
     static inline T * f( T & v, long )
@@ -39,12 +50,40 @@ template<class T> struct addressof_impl
 
 template<class T> T * addressof( T & v )
 {
+#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) )
+
     return boost::detail::addressof_impl<T>::f( v, 0 );
+
+#else
+
+    return boost::detail::addressof_impl<T>::f( boost::detail::addr_impl_ref<T>( v ), 0 );
+
+#endif
+}
+
+#if defined( __SUNPRO_CC ) && BOOST_WORKAROUND( __SUNPRO_CC, BOOST_TESTED_AT( 0x590 ) )
+
+namespace detail
+{
+
+template<class T> struct addressof_addp
+{
+    typedef T * type;
+};
+
+} // namespace detail
+
+template< class T, std::size_t N >
+typename detail::addressof_addp< T[N] >::type addressof( T (&t)[N] )
+{
+    return &t;
 }
 
+#endif
+
 // Borland doesn't like casting an array reference to a char reference
 // but these overloads work around the problem.
-# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+#if defined( __BORLANDC__ ) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
 template<typename T,std::size_t N>
 T (*addressof(T (&t)[N]))[N]
 {
@@ -56,7 +95,7 @@ const T (*addressof(const T (&t)[N]))[N]
 {
    return reinterpret_cast<const T(*)[N]>(&t);
 }
-# endif
+#endif
 
 } // namespace boost