|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78058 - in trunk/boost/fusion: adapted/std_tuple adapted/std_tuple/detail container/deque container/deque/detail container/list/detail container/map/detail container/vector/detail support/detail
From: joel_at_[hidden]
Date: 2012-04-17 22:57:57
Author: djowel
Date: 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
New Revision: 78058
URL: http://svn.boost.org/trac/boost/changeset/78058
Log:
tweaked cref_result and ref_result to be non-lazy (for consistency).
Text files modified:
trunk/boost/fusion/adapted/std_tuple/detail/at_impl.hpp | 10 +++++-----
trunk/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp | 10 +++++-----
trunk/boost/fusion/container/deque/cpp11_deque.hpp | 5 +++--
trunk/boost/fusion/container/deque/detail/keyed_element.hpp | 14 ++++----------
trunk/boost/fusion/container/list/detail/at_impl.hpp | 12 ++++++------
trunk/boost/fusion/container/map/detail/at_impl.hpp | 10 +++++++---
trunk/boost/fusion/container/map/detail/deref_data_impl.hpp | 9 ++++-----
trunk/boost/fusion/container/vector/detail/at_impl.hpp | 4 ++--
trunk/boost/fusion/container/vector/detail/deref_impl.hpp | 9 +++++----
trunk/boost/fusion/support/detail/access.hpp | 12 ++++++------
10 files changed, 47 insertions(+), 48 deletions(-)
Modified: trunk/boost/fusion/adapted/std_tuple/detail/at_impl.hpp
==============================================================================
--- trunk/boost/fusion/adapted/std_tuple/detail/at_impl.hpp (original)
+++ trunk/boost/fusion/adapted/std_tuple/detail/at_impl.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -9,7 +9,7 @@
#include <tuple>
#include <utility>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/remove_const.hpp>
@@ -29,13 +29,13 @@
struct apply
{
typedef typename remove_const<Sequence>::type seq_type;
- typedef std::tuple_element<N::value, seq_type> element;
+ typedef typename std::tuple_element<N::value, seq_type>::type element;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<Sequence>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
type;
Modified: trunk/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp
==============================================================================
--- trunk/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp (original)
+++ trunk/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -12,7 +12,7 @@
#include <boost/type_traits/remove_const.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/mpl/int.hpp>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
#include <tuple>
#include <utility>
@@ -48,12 +48,12 @@
template <typename Iterator>
struct deref
{
- typedef value_of<Iterator> element;
+ typedef typename value_of<Iterator>::type element;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<typename Iterator::tuple_type>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
type;
Modified: trunk/boost/fusion/container/deque/cpp11_deque.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/cpp11_deque.hpp (original)
+++ trunk/boost/fusion/container/deque/cpp11_deque.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -13,6 +13,7 @@
#include <boost/type_traits/is_convertible.hpp>
#include <boost/fusion/support/sequence_base.hpp>
+#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp>
#include <boost/fusion/container/deque/deque_fwd.hpp>
@@ -56,8 +57,8 @@
: base(seq)
{}
- explicit deque(typename add_reference<typename add_const<Head>::type>::type head
- , typename add_reference<typename add_const<Tail>::type>::type... tail)
+ explicit deque(typename detail::call_param<Head>::type head
+ , typename detail::call_param<Tail>::type... tail)
: base(detail::deque_keyed_values<Head, Tail...>::call(head, tail...))
{}
Modified: trunk/boost/fusion/container/deque/detail/keyed_element.hpp
==============================================================================
--- trunk/boost/fusion/container/deque/detail/keyed_element.hpp (original)
+++ trunk/boost/fusion/container/deque/detail/keyed_element.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -8,9 +8,7 @@
#if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330)
#define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/type_traits/add_const.hpp>
-
+#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
@@ -39,10 +37,6 @@
{
typedef Rest base;
typedef fusion_sequence_tag tag;
- typedef typename
- add_reference<typename add_const<Value>::type>::type
- const_value_type;
- typedef typename add_reference<Value>::type value_type;
using Rest::get;
template <typename It>
@@ -63,17 +57,17 @@
return *this;
}
- const_value_type get(Key) const
+ typename cref_result<Value>::type get(Key) const
{
return value_;
}
- value_type get(Key)
+ typename ref_result<Value>::type get(Key)
{
return value_;
}
- keyed_element(const_value_type value, Rest const& rest)
+ keyed_element(typename call_param<Value>::type value, Rest const& rest)
: Rest(rest), value_(value)
{}
Modified: trunk/boost/fusion/container/list/detail/at_impl.hpp
==============================================================================
--- trunk/boost/fusion/container/list/detail/at_impl.hpp (original)
+++ trunk/boost/fusion/container/list/detail/at_impl.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -10,7 +10,7 @@
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
@@ -93,15 +93,15 @@
template <typename Sequence, typename N>
struct apply
{
- typedef detail::cons_deref<
- typename detail::cons_advance<Sequence, N::value>::type>
+ typedef typename detail::cons_deref<
+ typename detail::cons_advance<Sequence, N::value>::type>::type
element;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<Sequence>
- , detail::cref_result<element>
- , detail::ref_result<element>
+ , typename detail::cref_result<element>::type
+ , typename detail::ref_result<element>::type
>::type
type;
Modified: trunk/boost/fusion/container/map/detail/at_impl.hpp
==============================================================================
--- trunk/boost/fusion/container/map/detail/at_impl.hpp (original)
+++ trunk/boost/fusion/container/map/detail/at_impl.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -28,7 +28,9 @@
template <typename Sequence, typename N>
struct apply
{
- typedef mpl::at<typename Sequence::storage_type::types, N> element;
+ typedef typename
+ mpl::at<typename Sequence::storage_type::types, N>::type
+ element;
typedef typename detail::ref_result<element>::type type;
static type
@@ -39,9 +41,11 @@
};
template <typename Sequence, typename N>
- struct apply <Sequence const, N>
+ struct apply<Sequence const, N>
{
- typedef mpl::at<typename Sequence::storage_type::types, N> element;
+ typedef typename
+ mpl::at<typename Sequence::storage_type::types, N>::type
+ element;
typedef typename detail::cref_result<element>::type type;
static type
Modified: trunk/boost/fusion/container/map/detail/deref_data_impl.hpp
==============================================================================
--- trunk/boost/fusion/container/map/detail/deref_data_impl.hpp (original)
+++ trunk/boost/fusion/container/map/detail/deref_data_impl.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -12,8 +12,7 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
+#include <boost/mpl/if.hpp>
namespace boost { namespace fusion { namespace extension
{
@@ -29,10 +28,10 @@
typedef typename result_of::value_of<It>::type::second_type data;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<typename It::seq_type>
- , detail::cref_result<mpl::identity<data> >
- , detail::ref_result<mpl::identity<data> >
+ , typename detail::cref_result<data>::type
+ , typename detail::ref_result<data>::type
>::type
type;
Modified: trunk/boost/fusion/container/vector/detail/at_impl.hpp
==============================================================================
--- trunk/boost/fusion/container/vector/detail/at_impl.hpp (original)
+++ trunk/boost/fusion/container/vector/detail/at_impl.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -27,7 +27,7 @@
template <typename Sequence, typename N>
struct apply
{
- typedef mpl::at<typename Sequence::types, N> element;
+ typedef typename mpl::at<typename Sequence::types, N>::type element;
typedef typename detail::ref_result<element>::type type;
static type
@@ -40,7 +40,7 @@
template <typename Sequence, typename N>
struct apply <Sequence const, N>
{
- typedef mpl::at<typename Sequence::types, N> element;
+ typedef typename mpl::at<typename Sequence::types, N>::type element;
typedef typename detail::cref_result<element>::type type;
static type
Modified: trunk/boost/fusion/container/vector/detail/deref_impl.hpp
==============================================================================
--- trunk/boost/fusion/container/vector/detail/deref_impl.hpp (original)
+++ trunk/boost/fusion/container/vector/detail/deref_impl.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -10,6 +10,7 @@
#include <boost/mpl/at.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp>
+#include <boost/mpl/if.hpp>
namespace boost { namespace fusion
{
@@ -29,14 +30,14 @@
typedef typename Iterator::vector vector;
typedef typename Iterator::index index;
typedef typename mpl::at<
- typename vector::types, index>
+ typename vector::types, index>::type
element;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<vector>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
type;
Modified: trunk/boost/fusion/support/detail/access.hpp
==============================================================================
--- trunk/boost/fusion/support/detail/access.hpp (original)
+++ trunk/boost/fusion/support/detail/access.hpp 2012-04-17 22:57:56 EDT (Tue, 17 Apr 2012)
@@ -1,7 +1,7 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_ACCESS_04182005_0737)
@@ -15,16 +15,16 @@
template <typename T>
struct ref_result
{
- typedef typename add_reference<typename T::type>::type type;
+ typedef typename add_reference<T>::type type;
};
template <typename T>
struct cref_result
{
- typedef typename
+ typedef typename
add_reference<
- typename add_const<typename T::type>::type
- >::type
+ typename add_const<T>::type
+ >::type
type;
};
@@ -35,7 +35,7 @@
};
template <typename T>
- struct call_param<T &>
+ struct call_param<T&>
{
typedef T& type;
};
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