forked from boostorg/fusion
tweaked cref_result and ref_result to be non-lazy (for consistency).
[SVN r78058]
This commit is contained in:
1 parent
c8224c8bdf
commit
01f002f084
10 files changed
+47
-48
No files matched your search
@@ -28,7 +28,9 @@ namespace boost { namespace fusion
|
||||
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 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
@@ -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 @@ namespace boost { namespace fusion { namespace extension
|
||||
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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user