|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50493 - sandbox/partition_point/boost/partition_point/detail
From: aschoedl_at_[hidden]
Date: 2009-01-06 05:17:17
Author: schoedl
Date: 2009-01-06 05:17:17 EST (Tue, 06 Jan 2009)
New Revision: 50493
URL: http://svn.boost.org/trac/boost/changeset/50493
Log:
added fall-back for BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Text files modified:
sandbox/partition_point/boost/partition_point/detail/lazy_typedef.hpp | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
Modified: sandbox/partition_point/boost/partition_point/detail/lazy_typedef.hpp
==============================================================================
--- sandbox/partition_point/boost/partition_point/detail/lazy_typedef.hpp (original)
+++ sandbox/partition_point/boost/partition_point/detail/lazy_typedef.hpp 2009-01-06 05:17:17 EST (Tue, 06 Jan 2009)
@@ -7,9 +7,7 @@
#include <boost/config.hpp>
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#error lazy_typedef.hpp requires partial template specialization!
-#endif
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // required for lazy_typedef to work as intended
namespace boost {
namespace detail {
@@ -17,8 +15,8 @@
}
}
-// Defines extract_some_typedef<T> which exposes T::some_typedef as extract_some_typedef<T>::type
-// if T::some_typedef exists. Otherwise extract_some_typedef<T> is empty.
+// Defines lazy_typedef_[some_typedef]<T> which exposes T::[some_typedef] as lazy_typedef_[some_typedef]<T>::type
+// if T::[some_typedef] exists. Otherwise lazy_typedef_[some_typedef]<T> is empty.
#define BOOST_DECLARE_LAZY_TYPEDEF( some_typedef ) \
template< typename C, typename Enable=void > \
struct lazy_typedef_ ## some_typedef \
@@ -30,4 +28,15 @@
typedef BOOST_DEDUCED_TYPENAME C::some_typedef type; \
};
-#endif // BOOST_PARTITION_POINT_LAZY_TYPEDEF_HPP
\ No newline at end of file
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#define BOOST_DECLARE_LAZY_TYPEDEF( some_typedef ) \
+ template< typename C > \
+ struct lazy_typedef_ ## some_typedef \
+ { \
+ typedef BOOST_DEDUCED_TYPENAME C::some_typedef type; \
+ };
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#endif // BOOST_PARTITION_POINT_LAZY_TYPEDEF_HPP
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk