2010-09-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Rewritten TripletGet.
	* src/Triplet.h
pull/1/head
Tatsuhiro Tsujikawa 2010-09-26 06:54:25 +00:00
parent e07f7207fa
commit 41a096035c
2 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2010-09-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten TripletGet.
* src/Triplet.h
2010-09-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten TripletNthType.

View File

@ -107,8 +107,8 @@ struct TripletGet;
template<>
struct TripletGet<1> {
template<typename T1, typename T2, typename T3>
static T1 get(const Triplet<T1, T2, T3>& tri)
template<class Triplet>
static typename TripletNthType<Triplet, 1>::type get(const Triplet& tri)
{
return tri.first;
}
@ -116,8 +116,8 @@ struct TripletGet<1> {
template<>
struct TripletGet<2> {
template<typename T1, typename T2, typename T3>
static T2 get(const Triplet<T1, T2, T3>& tri)
template<class Triplet>
static typename TripletNthType<Triplet, 2>::type get(const Triplet& tri)
{
return tri.second;
}
@ -125,8 +125,8 @@ struct TripletGet<2> {
template<>
struct TripletGet<3> {
template<typename T1, typename T2, typename T3>
static T3 get(const Triplet<T1, T2, T3>& tri)
template<class Triplet>
static typename TripletNthType<Triplet, 3>::type get(const Triplet& tri)
{
return tri.third;
}