mirror of
https://github.com/boostorg/parameter.git
synced 2026-01-27 07:02:12 +00:00
Add workarounds for GCC 3.x or earlier
* Fix compiler error: base `boost::reference_wrapper<int>' with only non-default constructor in class without a constructor. * Ignore normalized_argument_types test failures.
This commit is contained in:
@@ -51,7 +51,8 @@ namespace boost { namespace parameter { namespace aux {
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/tti/detail/dnullptr.hpp>
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
|
||||
!BOOST_WORKAROUND(BOOST_GCC, < 40000)
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#endif
|
||||
|
||||
@@ -83,7 +84,8 @@ namespace boost { namespace parameter { namespace aux {
|
||||
value> type;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) || \
|
||||
BOOST_WORKAROUND(BOOST_GCC, < 40000)
|
||||
template <
|
||||
typename T
|
||||
, typename = typename ::boost::parameter::aux
|
||||
@@ -103,7 +105,7 @@ namespace boost { namespace parameter { namespace aux {
|
||||
struct unwrap_cv_reference<T,::boost::mpl::true_> : T
|
||||
{
|
||||
};
|
||||
#else // !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
#else // no Borland or GCC 3- workarounds needed
|
||||
// Needed for unwrap_cv_reference below. T might be const, so
|
||||
// eval_if<> might fail because of deriving from T const on EDG.
|
||||
template <typename T>
|
||||
@@ -123,7 +125,7 @@ namespace boost { namespace parameter { namespace aux {
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif // Borland workarounds needed.
|
||||
#endif // Borland or GCC 3- workarounds needed
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -5,17 +5,14 @@
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#if (BOOST_PARAMETER_MAX_ARITY < 2)
|
||||
#error Define BOOST_PARAMETER_MAX_ARITY as 2 or greater.
|
||||
#endif
|
||||
#if (BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY < 3)
|
||||
#if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) && \
|
||||
(BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY < 3)
|
||||
#error Define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY \
|
||||
as 3 or greater.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <boost/parameter.hpp>
|
||||
|
||||
namespace test {
|
||||
|
||||
@@ -50,11 +47,17 @@ namespace test {
|
||||
};
|
||||
|
||||
std::size_t count_instances::count = 0;
|
||||
} // namespace test
|
||||
|
||||
#include <boost/parameter/name.hpp>
|
||||
|
||||
namespace test {
|
||||
|
||||
BOOST_PARAMETER_NAME(x)
|
||||
BOOST_PARAMETER_NAME(y)
|
||||
} // namespace test
|
||||
|
||||
#include <boost/parameter/preprocessor.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
@@ -107,7 +110,9 @@ namespace test {
|
||||
>::type
|
||||
));
|
||||
x.noop();
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC, < 40000)
|
||||
BOOST_TEST_LT(0, test::count_instances::count);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -125,7 +130,9 @@ namespace test {
|
||||
>::type
|
||||
));
|
||||
x.noop();
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC, < 40000)
|
||||
BOOST_TEST_EQ(1, test::count_instances::count);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
} // namespace test
|
||||
|
||||
Reference in New Issue
Block a user