fixed g++ complaining "error: shadows template parm"

[SVN r35346]
This commit is contained in:
Joel de Guzman
2006-09-26 22:25:45 +00:00
parent 6723082617
commit 1f9388ec86
3 changed files with 50 additions and 50 deletions

View File

@ -19,14 +19,14 @@
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
template <typename Iterator> template <typename Iterator_>
struct mpl_iterator struct mpl_iterator
: iterator_facade< : iterator_facade<
mpl_iterator<Iterator> mpl_iterator<Iterator_>
, typename detail::mpl_iterator_category<typename Iterator::category>::type , typename detail::mpl_iterator_category<typename Iterator_::category>::type
> >
{ {
typedef typename remove_const<Iterator>::type iterator_type; typedef typename remove_const<Iterator_>::type iterator_type;
template <typename Iterator> template <typename Iterator>
struct value_of : mpl::deref<typename Iterator::iterator_type> {}; struct value_of : mpl::deref<typename Iterator::iterator_type> {};

View File

@ -21,65 +21,65 @@ namespace boost { namespace fusion
{ {
struct random_access_traversal_tag; struct random_access_traversal_tag;
template <typename Pair, int N> template <typename Pair_, int N>
struct std_pair_iterator struct std_pair_iterator
: iterator_facade<std_pair_iterator<Pair, N>, random_access_traversal_tag> : iterator_facade<std_pair_iterator<Pair_, N>, random_access_traversal_tag>
{ {
BOOST_MPL_ASSERT_RELATION(N, >=, 0); BOOST_MPL_ASSERT_RELATION(N, >=, 0);
BOOST_MPL_ASSERT_RELATION(N, <=, 2); BOOST_MPL_ASSERT_RELATION(N, <=, 2);
typedef mpl::int_<N> index; typedef mpl::int_<N> index;
typedef Pair pair_type; typedef Pair_ pair_type;
std_pair_iterator(Pair& pair) std_pair_iterator(Pair_& pair)
: pair(pair) {} : pair(pair) {}
Pair& pair; Pair_& pair;
template <typename Iterator> template <typename Iterator>
struct value_of; struct value_of;
template <typename Pair_> template <typename Pair>
struct value_of<std_pair_iterator<Pair_, 0> > struct value_of<std_pair_iterator<Pair, 0> >
: mpl::identity<typename Pair_::first_type> {}; : mpl::identity<typename Pair::first_type> {};
template <typename Pair_> template <typename Pair>
struct value_of<std_pair_iterator<Pair_, 1> > struct value_of<std_pair_iterator<Pair, 1> >
: mpl::identity<typename Pair_::second_type> {}; : mpl::identity<typename Pair::second_type> {};
template <typename Iterator> template <typename Iterator>
struct deref; struct deref;
template <typename Pair_> template <typename Pair>
struct deref<std_pair_iterator<Pair_, 0> > struct deref<std_pair_iterator<Pair, 0> >
{ {
typedef typename typedef typename
mpl::if_< mpl::if_<
is_const<Pair_> is_const<Pair>
, typename Pair_::first_type const& , typename Pair::first_type const&
, typename Pair_::first_type& , typename Pair::first_type&
>::type >::type
type; type;
static type static type
call(std_pair_iterator<Pair_, 0> const& iter) call(std_pair_iterator<Pair, 0> const& iter)
{ {
return iter.pair.first; return iter.pair.first;
} }
}; };
template <typename Pair_> template <typename Pair>
struct deref<std_pair_iterator<Pair_, 1> > struct deref<std_pair_iterator<Pair, 1> >
{ {
typedef typename typedef typename
mpl::if_< mpl::if_<
is_const<Pair_> is_const<Pair>
, typename Pair_::second_type const& , typename Pair::second_type const&
, typename Pair_::second_type& , typename Pair::second_type&
>::type >::type
type; type;
static type static type
call(std_pair_iterator<Pair_, 1> const& iter) call(std_pair_iterator<Pair, 1> const& iter)
{ {
return iter.pair.second; return iter.pair.second;
} }

View File

@ -21,65 +21,65 @@ namespace boost { namespace fusion
{ {
struct random_access_traversal_tag; struct random_access_traversal_tag;
template <typename Pair, int N> template <typename Pair_, int N>
struct std_pair_iterator struct std_pair_iterator
: iterator_facade<std_pair_iterator<Pair, N>, random_access_traversal_tag> : iterator_facade<std_pair_iterator<Pair_, N>, random_access_traversal_tag>
{ {
BOOST_MPL_ASSERT_RELATION(N, >=, 0); BOOST_MPL_ASSERT_RELATION(N, >=, 0);
BOOST_MPL_ASSERT_RELATION(N, <=, 2); BOOST_MPL_ASSERT_RELATION(N, <=, 2);
typedef mpl::int_<N> index; typedef mpl::int_<N> index;
typedef Pair pair_type; typedef Pair_ pair_type;
std_pair_iterator(Pair& pair) std_pair_iterator(Pair_& pair)
: pair(pair) {} : pair(pair) {}
Pair& pair; Pair_& pair;
template <typename Iterator> template <typename Iterator>
struct value_of; struct value_of;
template <typename Pair_> template <typename Pair>
struct value_of<std_pair_iterator<Pair_, 0> > struct value_of<std_pair_iterator<Pair, 0> >
: mpl::identity<typename Pair_::first_type> {}; : mpl::identity<typename Pair::first_type> {};
template <typename Pair_> template <typename Pair>
struct value_of<std_pair_iterator<Pair_, 1> > struct value_of<std_pair_iterator<Pair, 1> >
: mpl::identity<typename Pair_::second_type> {}; : mpl::identity<typename Pair::second_type> {};
template <typename Iterator> template <typename Iterator>
struct deref; struct deref;
template <typename Pair_> template <typename Pair>
struct deref<std_pair_iterator<Pair_, 0> > struct deref<std_pair_iterator<Pair, 0> >
{ {
typedef typename typedef typename
mpl::if_< mpl::if_<
is_const<Pair_> is_const<Pair>
, typename Pair_::first_type const& , typename Pair::first_type const&
, typename Pair_::first_type& , typename Pair::first_type&
>::type >::type
type; type;
static type static type
call(std_pair_iterator<Pair_, 0> const& iter) call(std_pair_iterator<Pair, 0> const& iter)
{ {
return iter.pair.first; return iter.pair.first;
} }
}; };
template <typename Pair_> template <typename Pair>
struct deref<std_pair_iterator<Pair_, 1> > struct deref<std_pair_iterator<Pair, 1> >
{ {
typedef typename typedef typename
mpl::if_< mpl::if_<
is_const<Pair_> is_const<Pair>
, typename Pair_::second_type const& , typename Pair::second_type const&
, typename Pair_::second_type& , typename Pair::second_type&
>::type >::type
type; type;
static type static type
call(std_pair_iterator<Pair_, 1> const& iter) call(std_pair_iterator<Pair, 1> const& iter)
{ {
return iter.pair.second; return iter.pair.second;
} }