File indexing completed on 2026-08-06 09:38:32
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ThePEG_Triplet_H
0010 #define ThePEG_Triplet_H
0011
0012 #include "ThePEG/Config/ThePEG.h"
0013
0014 namespace ThePEG {
0015
0016
0017
0018
0019
0020 template <typename T1, typename T2, typename T3>
0021 struct Triplet {
0022
0023
0024 typedef T1 first_type;
0025
0026 typedef T2 second_type;
0027
0028 typedef T3 third_type;
0029
0030
0031 T1 first;
0032
0033 T2 second;
0034
0035 T3 third;
0036
0037
0038 Triplet() : first(T1()), second(T2()), third(T3()) {}
0039
0040
0041 Triplet(const T1 & t1, const T2 & t2, const T3 & t3)
0042 : first(t1), second(t2), third(t3) {}
0043
0044
0045 Triplet(const Triplet<T1,T2,T3> & t)
0046 : first(t.first), second(t.second), third(t.third) {}
0047
0048
0049 template <typename U1, typename U2, typename U3>
0050 Triplet(const Triplet<U1,U2,U3> & u)
0051 : first(u.first), second(u.second), third(u.third) {}
0052
0053
0054 bool operator==(const Triplet<T1,T2,T3> & t) const {
0055 return first == t.first && second == t.second && third == t.third;
0056 }
0057
0058
0059
0060
0061
0062 bool operator<(const Triplet<T1,T2,T3> & t) const {
0063 return first < t.first ||
0064 ( !(t.first < first) &&
0065 ( second < t.second ||
0066 ( !(t.second < second) && third < t.third )));
0067 }
0068 };
0069
0070
0071
0072 template <typename T1, typename T2, typename T3>
0073 inline Triplet<T1,T2,T3>
0074 makeTriplet (const T1 & t1, const T2 & t2, const T3 & t3)
0075 {
0076 return Triplet<T1,T2,T3>(t1, t2, t3);
0077 }
0078
0079
0080 template <typename OStream, typename T1, typename T2, typename T3>
0081 OStream & operator<<(OStream & os, const Triplet<T1,T2,T3> & t) {
0082 return os << t.first << t.second << t.third;
0083 }
0084
0085
0086 template <typename IStream, typename T1, typename T2, typename T3>
0087 IStream & operator>>(IStream & is, Triplet<T1,T2,T3> & t) {
0088 return is >> t.first >> t.second >> t.third;
0089 }
0090
0091 }
0092
0093 #endif