mirror of
https://github.com/boostorg/utility.git
synced 2025-07-30 12:57:31 +02:00
Join ralf_grosse_kunstleve with HEAD
[SVN r9444]
This commit is contained in:
@ -14,15 +14,10 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include <boost/compressed_pair.hpp>
|
#include <boost/compressed_pair.hpp>
|
||||||
#include "type_traits_test.hpp"
|
#include <boost/type_traits/type_traits_test.hpp>
|
||||||
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
|
|
||||||
struct empty_POD_UDT{};
|
|
||||||
struct empty_UDT
|
|
||||||
{
|
|
||||||
~empty_UDT(){};
|
|
||||||
};
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||||
template <> struct is_empty<empty_UDT>
|
template <> struct is_empty<empty_UDT>
|
||||||
@ -59,7 +54,7 @@ struct non_empty2
|
|||||||
{ return a.i == b.i; }
|
{ return a.i == b.i; }
|
||||||
};
|
};
|
||||||
|
|
||||||
int main()
|
int main(int argc, char *argv[ ])
|
||||||
{
|
{
|
||||||
compressed_pair<int, double> cp1(1, 1.3);
|
compressed_pair<int, double> cp1(1, 1.3);
|
||||||
assert(cp1.first() == 1);
|
assert(cp1.first() == 1);
|
||||||
@ -101,15 +96,13 @@ int main()
|
|||||||
cp7.first();
|
cp7.first();
|
||||||
double* pd = cp7.second();
|
double* pd = cp7.second();
|
||||||
#endif
|
#endif
|
||||||
value_test(true, (sizeof(compressed_pair<empty_UDT, int>) < sizeof(std::pair<empty_UDT, int>)))
|
soft_value_test(true, (sizeof(compressed_pair<empty_UDT, int>) < sizeof(std::pair<empty_UDT, int>)))
|
||||||
value_test(true, (sizeof(compressed_pair<int, empty_UDT>) < sizeof(std::pair<int, empty_UDT>)))
|
soft_value_test(true, (sizeof(compressed_pair<int, empty_UDT>) < sizeof(std::pair<int, empty_UDT>)))
|
||||||
value_test(true, (sizeof(compressed_pair<empty_UDT, empty_UDT>) < sizeof(std::pair<empty_UDT, empty_UDT>)))
|
soft_value_test(true, (sizeof(compressed_pair<empty_UDT, empty_UDT>) < sizeof(std::pair<empty_UDT, empty_UDT>)))
|
||||||
value_test(true, (sizeof(compressed_pair<empty_UDT, empty_POD_UDT>) < sizeof(std::pair<empty_UDT, empty_POD_UDT>)))
|
soft_value_test(true, (sizeof(compressed_pair<empty_UDT, empty_POD_UDT>) < sizeof(std::pair<empty_UDT, empty_POD_UDT>)))
|
||||||
value_test(true, (sizeof(compressed_pair<empty_UDT, compressed_pair<empty_POD_UDT, int> >) < sizeof(std::pair<empty_UDT, std::pair<empty_POD_UDT, int> >)))
|
soft_value_test(true, (sizeof(compressed_pair<empty_UDT, compressed_pair<empty_POD_UDT, int> >) < sizeof(std::pair<empty_UDT, std::pair<empty_POD_UDT, int> >)))
|
||||||
|
|
||||||
std::cout << std::endl << test_count << " tests completed (" << failures << " failures)... press any key to exit";
|
return check_result(argc, argv);
|
||||||
std::cin.get();
|
|
||||||
return failures;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -154,6 +147,8 @@ template compressed_pair<double, int[2]>::compressed_pair();
|
|||||||
#endif // __MWERKS__
|
#endif // __MWERKS__
|
||||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||||
|
|
||||||
|
unsigned int expected_failures = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,8 +26,11 @@
|
|||||||
#define BOOST_OB_COMPRESSED_PAIR_HPP
|
#define BOOST_OB_COMPRESSED_PAIR_HPP
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#ifndef BOOST_TYPE_TRAITS_HPP
|
#ifndef BOOST_OBJECT_TYPE_TRAITS_HPP
|
||||||
#include <boost/type_traits.hpp>
|
#include <boost/type_traits/object_traits.hpp>
|
||||||
|
#endif
|
||||||
|
#ifndef BOOST_SAME_TRAITS_HPP
|
||||||
|
#include <boost/type_traits/same_traits.hpp>
|
||||||
#endif
|
#endif
|
||||||
#ifndef BOOST_CALL_TRAITS_HPP
|
#ifndef BOOST_CALL_TRAITS_HPP
|
||||||
#include <boost/call_traits.hpp>
|
#include <boost/call_traits.hpp>
|
||||||
|
Reference in New Issue
Block a user