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 cppfreetype.
5  *
6  * cppfreetype 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  * cppfreetype 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 cppfreetype. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef CPPFREETYPE_ERRORPAIR_H_
28 #define CPPFREETYPE_ERRORPAIR_H_
29 
30 #include <cpp_freetype/types.h>
31 
32 namespace freetype {
33 
35 template <typename T1, typename T2 >
36 struct RValuePair
37 {
38  T1 p1;
39  T2 p2;
40 
41  RValuePair( T1 p1_in, const T2 p2_in):
42  p1(p1_in),
43  p2(p2_in)
44  {}
45 };
46 
48 template <typename T1, typename T2 >
49 struct LValuePair
50 {
51  T1& p1;
52  T2& p2;
53 
54  LValuePair( T1& p1_ref, T2& p2_ref):
55  p1(p1_ref),
56  p2(p2_ref)
57  {}
58 
60  {
61  p1 = copy.p1;
62  p2 = copy.p2;
63  }
64 };
65 
66 } // namespace freetype
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 #endif // ERRORPAIR_H_
RValuePair(T1 p1_in, const T2 p2_in)
allows an error to be returned with a result in a single expression
LValuePair(T1 &p1_ref, T2 &p2_ref)
Char8_t * copy(const Char8_t *s)
void operator=(const RValuePair< T1, T2 > &copy)
allows an error to be returned with a result in a single expression