mirror of
https://github.com/boostorg/utility.git
synced 2025-10-05 13:30:55 +02:00
Compare commits
4 Commits
boost-1.81
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
|
6741375cae | ||
|
f0f76aaff1 | ||
|
d6c957da65 | ||
|
9862788664 |
@@ -291,6 +291,6 @@ www.boost.org/LICENSE_1_0.txt</a>)</p>
|
|||||||
<P>Developed by <A HREF="mailto:fernando_cacciola@hotmail.com">Fernando Cacciola</A>,
|
<P>Developed by <A HREF="mailto:fernando_cacciola@hotmail.com">Fernando Cacciola</A>,
|
||||||
the latest version of this file can be found at <A
|
the latest version of this file can be found at <A
|
||||||
HREF="http://www.boost.org">www.boost.org</A>, and the boost
|
HREF="http://www.boost.org">www.boost.org</A>, and the boost
|
||||||
<A HREF="http://www.boost.org/more/mailing_lists.htm#main">discussion lists</A></P>
|
<A HREF="http://www.boost.org/community/groups.html#main">discussion lists</A></P>
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
@@ -1,6 +1,7 @@
|
|||||||
// Copyright (C) 2002 Brad King (brad.king@kitware.com)
|
// Copyright (C) 2002 Brad King (brad.king@kitware.com)
|
||||||
// Douglas Gregor (gregod@cs.rpi.edu)
|
// Douglas Gregor (gregod@cs.rpi.edu)
|
||||||
// Peter Dimov
|
//
|
||||||
|
// Copyright (C) 2002, 2008 Peter Dimov
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
@@ -14,27 +15,31 @@
|
|||||||
# include <boost/config.hpp>
|
# include <boost/config.hpp>
|
||||||
# include <boost/detail/workaround.hpp>
|
# include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost
|
||||||
|
|
||||||
// Do not make addressof() inline. Breaks MSVC 7. (Peter Dimov)
|
|
||||||
|
|
||||||
// VC7 strips const from nested classes unless we add indirection here
|
|
||||||
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
|
||||||
|
|
||||||
template<class T> struct _addp
|
|
||||||
{
|
{
|
||||||
typedef T * type;
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class T> struct addressof_impl
|
||||||
|
{
|
||||||
|
static inline T * f( T & v, long )
|
||||||
|
{
|
||||||
|
return reinterpret_cast<T*>(
|
||||||
|
&const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline T * f( T * v, int )
|
||||||
|
{
|
||||||
|
return v;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T> typename _addp<T>::type
|
|
||||||
|
|
||||||
# else
|
} // namespace detail
|
||||||
template <typename T> T*
|
|
||||||
# endif
|
template<class T> T * addressof( T & v )
|
||||||
addressof(T& v)
|
|
||||||
{
|
{
|
||||||
return reinterpret_cast<T*>(
|
return boost::detail::addressof_impl<T>::f( v, 0 );
|
||||||
&const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Borland doesn't like casting an array reference to a char reference
|
// Borland doesn't like casting an array reference to a char reference
|
||||||
@@ -53,6 +58,6 @@ const T (*addressof(const T (&t)[N]))[N]
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
}
|
} // namespace boost
|
||||||
|
|
||||||
#endif // BOOST_UTILITY_ADDRESSOF_HPP
|
#endif // BOOST_UTILITY_ADDRESSOF_HPP
|
||||||
|
@@ -315,7 +315,7 @@ Last modified: Mon Aug 11 11:27:03 EST 2003
|
|||||||
<p><EFBFBD> Copyright 2003 The Trustees of Indiana University.
|
<p><EFBFBD> Copyright 2003 The Trustees of Indiana University.
|
||||||
Use, modification and distribution is subject to the Boost Software
|
Use, modification and distribution is subject to the Boost Software
|
||||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
http:www.boost.org/LICENSE_1_0.txt)</p>
|
http://www.boost.org/LICENSE_1_0.txt)</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
0
test/next_prior_test.cpp
Executable file → Normal file
0
test/next_prior_test.cpp
Executable file → Normal file
Reference in New Issue
Block a user