|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67352 - trunk/boost/fusion/sequence/intrinsic
From: mr.chr.schmidt_at_[hidden]
Date: 2010-12-19 13:35:56
Author: cschmidt
Date: 2010-12-19 13:35:52 EST (Sun, 19 Dec 2010)
New Revision: 67352
URL: http://svn.boost.org/trac/boost/changeset/67352
Log:
Fusion: mask fusion::begin/fusion::end with SFINAE, fixes #4028
Text files modified:
trunk/boost/fusion/sequence/intrinsic/begin.hpp | 14 ++++++++++++--
trunk/boost/fusion/sequence/intrinsic/end.hpp | 14 ++++++++++++--
2 files changed, 24 insertions(+), 4 deletions(-)
Modified: trunk/boost/fusion/sequence/intrinsic/begin.hpp
==============================================================================
--- trunk/boost/fusion/sequence/intrinsic/begin.hpp (original)
+++ trunk/boost/fusion/sequence/intrinsic/begin.hpp 2010-12-19 13:35:52 EST (Sun, 19 Dec 2010)
@@ -8,6 +8,8 @@
#define FUSION_BEGIN_04052005_1132
#include <boost/fusion/support/tag_of.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -57,14 +59,22 @@
}
template <typename Sequence>
- inline typename result_of::begin<Sequence>::type const
+ inline typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::begin<Sequence>
+ >::type const
begin(Sequence& seq)
{
return result_of::begin<Sequence>::call(seq);
}
template <typename Sequence>
- inline typename result_of::begin<Sequence const>::type const
+ inline typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::begin<Sequence const>
+ >::type const
begin(Sequence const& seq)
{
return result_of::begin<Sequence const>::call(seq);
Modified: trunk/boost/fusion/sequence/intrinsic/end.hpp
==============================================================================
--- trunk/boost/fusion/sequence/intrinsic/end.hpp (original)
+++ trunk/boost/fusion/sequence/intrinsic/end.hpp 2010-12-19 13:35:52 EST (Sun, 19 Dec 2010)
@@ -8,6 +8,8 @@
#define FUSION_END_04052005_1141
#include <boost/fusion/support/tag_of.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -57,14 +59,22 @@
}
template <typename Sequence>
- inline typename result_of::end<Sequence>::type const
+ inline typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::end<Sequence>
+ >::type const
end(Sequence& seq)
{
return result_of::end<Sequence>::call(seq);
}
template <typename Sequence>
- inline typename result_of::end<Sequence const>::type const
+ inline typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::end<Sequence const>
+ >::type const
end(Sequence const& seq)
{
return result_of::end<Sequence const>::call(seq);
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