Commit 0d9709e1 by Daniel Frey Committed by Paolo Carlini

functional (_Index_tuple, [...]): Simplify and speed-up.

2010-01-22  Daniel Frey  <d.frey@gmx.de>

	* include/std/functional (_Index_tuple, _Build_index_tuple):
	Simplify and speed-up.

From-SVN: r156178
parent c47987fa
2010-01-22 Daniel Frey <d.frey@gmx.de>
* include/std/functional (_Index_tuple, _Build_index_tuple):
Simplify and speed-up.
2010-01-22 Joern Rennecke <amylaar@spamcop.net>
PR libstdc++/36101, PR libstdc++/42813
......
......@@ -847,22 +847,22 @@ namespace std
* in a tuple.
*/
template<int... _Indexes>
struct _Index_tuple { };
struct _Index_tuple
{
typedef _Index_tuple<_Indexes..., sizeof...(_Indexes)> __next;
};
/// Builds an _Index_tuple<0, 1, 2, ..., _Num-1>.
template<std::size_t _Num, typename _Tuple = _Index_tuple<> >
struct _Build_index_tuple;
template<std::size_t _Num, int... _Indexes>
struct _Build_index_tuple<_Num, _Index_tuple<_Indexes...> >
: _Build_index_tuple<_Num - 1,
_Index_tuple<_Indexes..., sizeof...(_Indexes)> >
{ };
template<std::size_t _Num>
struct _Build_index_tuple
{
typedef typename _Build_index_tuple<_Num-1>::__type::__next __type;
};
template<int... _Indexes>
struct _Build_index_tuple<0, _Index_tuple<_Indexes...> >
template<>
struct _Build_index_tuple<0>
{
typedef _Index_tuple<_Indexes...> __type;
typedef _Index_tuple<> __type;
};
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment