cheshirekow  v0.1.0
AssignmentPair.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of cppfontconfig.
5  *
6  * cppfontconfig is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * cppfontconfig is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with cppfontconfig. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef CPPFONTCONFIG_ASSIGNMENTPAIR_H_
28 #define CPPFONTCONFIG_ASSIGNMENTPAIR_H_
29 
30 
31 namespace fontconfig {
32 
34 template <typename T1, typename T2 >
35 struct RValuePair
36 {
37  T1 p1;
38  T2 p2;
39 
40  RValuePair( T1 p1_in, const T2 p2_in):
41  p1(p1_in),
42  p2(p2_in)
43  {}
44 };
45 
47 template <typename T1, typename T2 >
48 struct LValuePair
49 {
50  T1& p1;
51  T2& p2;
52 
53  LValuePair( T1& p1_ref, T2& p2_ref):
54  p1(p1_ref),
55  p2(p2_ref)
56  {}
57 
59  {
60  p1 = copy.p1;
61  p2 = copy.p2;
62  }
63 };
64 
65 } // namespace fontconfig
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 #endif // ERRORPAIR_H_
allows an error to be returned with a result in a single expression
RValuePair(T1 p1_in, const T2 p2_in)
void operator=(const RValuePair< T1, T2 > &copy)
LValuePair(T1 &p1_ref, T2 &p2_ref)
allows an error to be returned with a result in a single expression
Char8_t * copy(const Char8_t *s)