type_vec1.hpp
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include "../fwd.hpp"
32 #include "type_vec.hpp"
33 #ifdef GLM_SWIZZLE
34 # if GLM_HAS_ANONYMOUS_UNION
35 # include "_swizzle.hpp"
36 # else
37 # include "_swizzle_func.hpp"
38 # endif
39 #endif //GLM_SWIZZLE
40 #include <cstddef>
41 
42 namespace glm{
43 namespace detail
44 {
45  template <typename T, precision P>
46  struct tvec1
47  {
49  // Implementation detail
50 
51  enum ctor{_null};
52 
53  typedef tvec1<T, P> type;
55  typedef T value_type;
56 
58  // Helper
59 
61 
63  // Data
64 
65  union {T x, r, s;};
66 
68  // Accesses
69 
71  GLM_FUNC_DECL T const & operator[](length_t i) const;
72 
74  // Implicit basic constructors
75 
77  GLM_FUNC_DECL tvec1(tvec1<T, P> const & v);
78  template <precision Q>
79  GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);
80  template <typename U>
81  GLM_FUNC_DECL tvec1(U const & s);
82 
84  // Explicit basic constructors
85 
86  GLM_FUNC_DECL explicit tvec1(ctor);
87 
89  // Conversion vector constructors
90 
92  template <typename U, precision Q>
93  GLM_FUNC_DECL explicit tvec1(tvec1<U, Q> const & v);
95  template <typename U, precision Q>
96  GLM_FUNC_DECL explicit tvec1(tvec2<U, Q> const & v);
98  template <typename U, precision Q>
99  GLM_FUNC_DECL explicit tvec1(tvec3<U, Q> const & v);
101  template <typename U, precision Q>
102  GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
103 
105  // Unary arithmetic operators
106 
108 
109  template <typename U>
111  template <typename U>
112  GLM_FUNC_DECL tvec1<T, P> & operator+=(U const & s);
113  template <typename U>
115  template <typename U>
116  GLM_FUNC_DECL tvec1<T, P> & operator-=(U const & s);
117  template <typename U>
119  template <typename U>
120  GLM_FUNC_DECL tvec1<T, P> & operator*=(U const & s);
121  template <typename U>
123  template <typename U>
124  GLM_FUNC_DECL tvec1<T, P> & operator/=(U const & s);
125  template <typename U>
127 
129  // Increment and decrement operators
130 
135 
137  // Unary bit operators
138 
139  template <typename U>
140  GLM_FUNC_DECL tvec1<T, P> & operator%=(U const & s);
141  template <typename U>
143  template <typename U>
144  GLM_FUNC_DECL tvec1<T, P> & operator&=(U const & s);
145  template <typename U>
147  template <typename U>
148  GLM_FUNC_DECL tvec1<T, P> & operator|=(U const & s);
149  template <typename U>
151  template <typename U>
152  GLM_FUNC_DECL tvec1<T, P> & operator^=(U const & s);
153  template <typename U>
155  template <typename U>
156  GLM_FUNC_DECL tvec1<T, P> & operator<<=(U const & s);
157  template <typename U>
158  GLM_FUNC_DECL tvec1<T, P> & operator<<=(tvec1<U, P> const & v);
159  template <typename U>
160  GLM_FUNC_DECL tvec1<T, P> & operator>>=(U const & s);
161  template <typename U>
163  };
164 
165 
166  template <typename T, precision P>
167  GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v, T const & s);
168 
169  template <typename T, precision P>
170  GLM_FUNC_DECL tvec1<T, P> operator+(T const & s, tvec1<T, P> const & v);
171 
172  template <typename T, precision P>
174 
175  template <typename T, precision P>
176  GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v, T const & s);
177 
178  template <typename T, precision P>
179  GLM_FUNC_DECL tvec1<T, P> operator-(T const & s, tvec1<T, P> const & v);
180 
181  template <typename T, precision P>
183 
184  template <typename T, precision P>
185  GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v, T const & s);
186 
187  template <typename T, precision P>
188  GLM_FUNC_DECL tvec1<T, P> operator*(T const & s, tvec1<T, P> const & v);
189 
190  template <typename T, precision P>
192 
193  template <typename T, precision P>
194  GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v, T const & s);
195 
196  template <typename T, precision P>
197  GLM_FUNC_DECL tvec1<T, P> operator/(T const & s, tvec1<T, P> const & v);
198 
199  template <typename T, precision P>
201 
202  template <typename T, precision P>
204 
205  template <typename T, precision P>
206  GLM_FUNC_DECL bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
207 
208  template <typename T, precision P>
209  GLM_FUNC_DECL bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
210 
211  template <typename T, precision P>
212  GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v, T const & s);
213 
214  template <typename T, precision P>
215  GLM_FUNC_DECL tvec1<T, P> operator%(T const & s, tvec1<T, P> const & v);
216 
217  template <typename T, precision P>
219 
220  template <typename T, precision P>
221  GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v, T const & s);
222 
223  template <typename T, precision P>
224  GLM_FUNC_DECL tvec1<T, P> operator&(T const & s, tvec1<T, P> const & v);
225 
226  template <typename T, precision P>
228 
229  template <typename T, precision P>
230  GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v, T const & s);
231 
232  template <typename T, precision P>
233  GLM_FUNC_DECL tvec1<T, P> operator|(T const & s, tvec1<T, P> const & v);
234 
235  template <typename T, precision P>
237 
238  template <typename T, precision P>
239  GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v, T const & s);
240 
241  template <typename T, precision P>
242  GLM_FUNC_DECL tvec1<T, P> operator^(T const & s, tvec1<T, P> const & v);
243 
244  template <typename T, precision P>
246 
247  template <typename T, precision P>
248  GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v, T const & s);
249 
250  template <typename T, precision P>
251  GLM_FUNC_DECL tvec1<T, P> operator<<(T const & s, tvec1<T, P> const & v);
252 
253  template <typename T, precision P>
254  GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
255 
256  template <typename T, precision P>
257  GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v, T const & s);
258 
259  template <typename T, precision P>
260  GLM_FUNC_DECL tvec1<T, P> operator>>(T const & s, tvec1<T, P> const & v);
261 
262  template <typename T, precision P>
264 
265  template <typename T, precision P>
267 
268 }//namespace detail
269 }//namespace glm
270 
271 #ifndef GLM_EXTERNAL_TEMPLATE
272 #include "type_vec1.inl"
273 #endif//GLM_EXTERNAL_TEMPLATE
GLM_FUNC_DECL tvec1< T, P > operator^(tvec1< T, P > const &v, T const &s)
GLM_FUNC_DECL tvec1< T, P > operator&(tvec1< T, P > const &v, T const &s)
GLM_FUNC_DECL tvec1< T, P > & operator^=(U const &s)
GLM_FUNC_DECL tvec1< T, P > & operator<<=(U const &s)
int length_t
Definition: setup.hpp:755
GLM_FUNC_DECL tvec1< T, P > & operator=(tvec1< T, P > const &v)
GLM_FUNC_DECL T & operator[](length_t i)
GLM_FUNC_DECL tvec1< T, P > operator|(tvec1< T, P > const &v, T const &s)
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const
GLM_FUNC_DECL tvec1< T, P > & operator*=(U const &s)
GLM_FUNC_DECL tvec1< T, P > operator~(tvec1< T, P > const &v)
GLM_FUNC_DECL tmat2x2< T, P > operator*(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL tmat2x2< T, P > operator+(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL tmat2x2< T, P > operator/(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL bool operator==(tvec1< T, P > const &v1, tvec1< T, P > const &v2)
GLM_FUNC_DECL tvec1< T, P > & operator/=(U const &s)
GLM_FUNC_DECL tmat2x2< T, P > operator-(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL tvec1< T, P > & operator+=(U const &s)
GLM_FUNC_DECL tvec1< T, P > operator%(tvec1< T, P > const &v, T const &s)
GLM_FUNC_DECL tvec1< T, P > & operator%=(U const &s)
GLM_FUNC_DECL bool operator!=(tvec1< T, P > const &v1, tvec1< T, P > const &v2)
GLM_FUNC_DECL tvec1()
GLM_FUNC_DECL tvec1< T, P > & operator>>=(U const &s)
GLM_FUNC_DECL tvec1< T, P > & operator|=(U const &s)
GLM_FUNC_DECL tvec1< T, P > & operator++()
GLM_FUNC_DECL tvec1< T, P > & operator--()
tvec1< bool, P > bool_type
Definition: type_vec1.hpp:54
GLM_FUNC_DECL tvec1< T, P > operator>>(tvec1< T, P > const &v, T const &s)
#define GLM_CONSTEXPR
Definition: setup.hpp:801
GLM_FUNC_DECL tvec1< T, P > & operator-=(U const &s)
#define GLM_FUNC_DECL
Definition: setup.hpp:728
tvec1< T, P > type
Definition: type_vec1.hpp:53
GLM_FUNC_DECL tvec1< T, P > & operator&=(U const &s)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:43:40