Re: [boost] [fusion] list/detail/at_impl.hpp, Suggest recru…

Top Page

Reply to this message
Author: Larry Evans
Date:  
To: boost
Old-Topics: Re: [boost] [fusion] list/detail/at_impl.hpp, Suggest recrusive elem_at_c instead of recursive apply
Subject: Re: [boost] [fusion] list/detail/at_impl.hpp, Suggest recrusive elem_at_c instead of recursive apply
On 05/17/06 01:10, Joel de Guzman wrote:
> Larry Evans wrote:
>> In boost/fusion/.../list/detail/at_impl.hpp

[snip]
> Looks good to me. Do you have a patch?

Attached is a recent svn diff and the command used to produce it.
Is there anything else needed to make this change?

-regards,
Larry
Index: at_impl.hpp
===================================================================
--- at_impl.hpp    (revision 40427)
+++ at_impl.hpp    (working copy)
@@ -25,25 +25,22 @@
template <>
struct at_impl<cons_tag>
{
- template <typename Sequence, typename N>
- struct apply
+ template <typename Sequence, int N>
+ struct elem_at_c
{
- typedef typename
- mpl::eval_if<
- is_const<Sequence>
- , add_const<typename Sequence::cdr_type>
- , mpl::identity<typename Sequence::cdr_type>
- >::type
- cdr_type;
-
typedef typename
mpl::eval_if<
- mpl::bool_<N::value == 0>
+ mpl::bool_<N == 0>
, mpl::identity<typename Sequence::car_type>
- , apply<cdr_type, mpl::int_<N::value-1> >
- >
- element;
+ , elem_at_c<typename Sequence::cdr_type, N-1>
+ >::type
+ type;
+ };

+ template <typename Sequence, typename N>
+ struct apply
+ {
+ typedef elem_at_c<Sequence, N::value> element;
typedef typename
mpl::eval_if<
is_const<Sequence>
cd ~/prog_dev/boost-svn/ro/trunk/boost/fusion/container/list/detail/
svn diff at_impl.hpp > x.diff

Compilation finished at Wed Oct 24 13:40:21
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost