mirror of
https://github.com/boostorg/align.git
synced 2026-07-21 13:13:31 +00:00
Correct unit tests for adaptor and trait
This commit is contained in:
@@ -36,6 +36,9 @@ struct integral_constant {
|
||||
|
||||
BOOST_STATIC_CONSTEXPR T value = Value;
|
||||
};
|
||||
|
||||
template<class T, T Value>
|
||||
BOOST_CONSTEXPR_OR_CONST T integral_constant<T, Value>::value;
|
||||
#endif
|
||||
|
||||
} /* detail */
|
||||
|
||||
+4
-5
@@ -9,15 +9,14 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="refresh" content="0;url=../../doc/html/align.html">
|
||||
<meta http-equiv="refresh" content="0; url=../../doc/html/align.html">
|
||||
<title>Boost.Align</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
Redirecting to <a href="../../doc/html/align.html">Boost.Align</a>.
|
||||
</p>
|
||||
<p>
|
||||
© 2014-2015 Glen Fernandes
|
||||
Redirecting you to <a href="../../doc/html/align.html">Boost.Align</a>
|
||||
</p>
|
||||
<hr>
|
||||
Copyright 2014-2015 Glen Fernandes
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -15,6 +15,9 @@ template<class T>
|
||||
class A {
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
template<class U>
|
||||
struct rebind {
|
||||
@@ -28,7 +31,7 @@ public:
|
||||
A(const A<U>& other)
|
||||
: state_(other.state()) { }
|
||||
|
||||
T* allocate(std::size_t size) {
|
||||
T* allocate(std::size_t size, const void* = 0) {
|
||||
return static_cast<T*>(::operator new(sizeof(T) * size));
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#define OFFSETOF(t, m) ((std::size_t)(&((t*)0)->m))
|
||||
#define OFFSET(t, m) ((std::size_t)(&((t*)0)->m))
|
||||
|
||||
template<class T>
|
||||
struct remove_reference {
|
||||
@@ -73,8 +73,8 @@ struct offset_value {
|
||||
template<class T>
|
||||
void test_type()
|
||||
{
|
||||
BOOST_TEST_EQ(boost::alignment::alignment_of<T>::value,
|
||||
OFFSETOF(offset_value<T>, object));
|
||||
BOOST_TEST_EQ(OFFSET(offset_value<T>, object),
|
||||
boost::alignment::alignment_of<T>::value);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
||||
Reference in New Issue
Block a user