Correct unit tests for adaptor and trait

This commit is contained in:
Glen Fernandes
2017-03-15 22:34:59 -04:00
parent 3bfcbc523f
commit f90f7ba4f2
4 changed files with 14 additions and 9 deletions
@@ -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
View File
@@ -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>
&copy; 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>
+4 -1
View File
@@ -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));
}
+3 -3
View File
@@ -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>