Skip to content

Commit dc12a02

Browse files
committed
Use using instead of typedefs
1 parent 8f6213d commit dc12a02

File tree

148 files changed

+2703
-2703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+2703
-2703
lines changed

glm/detail/_swizzle.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ namespace detail
162162
template<length_t N, typename T, qualifier Q, int E0, int E1, int E2, int E3>
163163
struct _swizzle : public _swizzle_base2<N, T, Q, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)>
164164
{
165-
typedef _swizzle_base2<N, T, Q, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)> base_type;
165+
using base_type = _swizzle_base2<N, T, Q, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)>;
166166

167167
using base_type::operator=;
168168

glm/detail/qualifier.hpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace glm
3030
# endif
3131
};
3232

33-
typedef qualifier precision;
33+
using precision = qualifier;
3434

3535
template<length_t L, typename T, qualifier Q = defaultp> struct vec;
3636
template<length_t C, length_t R, typename T, qualifier Q = defaultp> struct mat;
@@ -107,69 +107,69 @@ namespace detail
107107
template<>
108108
struct storage<4, float, true>
109109
{
110-
typedef glm_f32vec4 type;
110+
using type = glm_f32vec4;
111111
};
112112

113113
template<>
114114
struct storage<4, int, true>
115115
{
116-
typedef glm_i32vec4 type;
116+
using type = glm_i32vec4;
117117
};
118118

119119
template<>
120120
struct storage<4, unsigned int, true>
121121
{
122-
typedef glm_u32vec4 type;
122+
using type = glm_u32vec4;
123123
};
124124

125125
template<>
126126
struct storage<3, float, true>
127127
{
128-
typedef glm_f32vec4 type;
128+
using type = glm_f32vec4;
129129
};
130130

131131
template<>
132132
struct storage<3, int, true>
133133
{
134-
typedef glm_i32vec4 type;
134+
using type = glm_i32vec4;
135135
};
136136

137137
template<>
138138
struct storage<3, unsigned int, true>
139139
{
140-
typedef glm_u32vec4 type;
140+
using type = glm_u32vec4;
141141
};
142142

143143
template<>
144144
struct storage<2, double, true>
145145
{
146-
typedef glm_f64vec2 type;
146+
using type = glm_f64vec2;
147147
};
148148

149149
template<>
150150
struct storage<2, detail::int64, true>
151151
{
152-
typedef glm_i64vec2 type;
152+
using type = glm_i64vec2;
153153
};
154154

155155
template<>
156156
struct storage<2, detail::uint64, true>
157157
{
158-
typedef glm_u64vec2 type;
158+
using type = glm_u64vec2;
159159
};
160160

161161

162162
template<>
163163
struct storage<3, detail::uint64, true>
164164
{
165-
typedef glm_u64vec2 type;
165+
using type = glm_u64vec2;
166166
};
167167

168168
template<>
169169
struct storage<4, double, true>
170170
{
171171
# if (GLM_ARCH & GLM_ARCH_AVX_BIT)
172-
typedef glm_f64vec4 type;
172+
using type = glm_f64vec4;
173173
# else
174174
struct type
175175
{
@@ -195,21 +195,21 @@ namespace detail
195195
template<>
196196
struct storage<4, detail::int64, true>
197197
{
198-
typedef glm_i64vec4 type;
198+
using type = glm_i64vec4;
199199
};
200200

201201
template<>
202202
struct storage<4, detail::uint64, true>
203203
{
204-
typedef glm_u64vec4 type;
204+
using type = glm_u64vec4;
205205
};
206206
# endif
207207

208208
# if GLM_ARCH & GLM_ARCH_NEON_BIT
209209
template<>
210210
struct storage<4, float, true>
211211
{
212-
typedef glm_f32vec4 type;
212+
using type = glm_f32vec4;
213213
};
214214

215215
template<>
@@ -219,7 +219,7 @@ namespace detail
219219
template<>
220220
struct storage<4, int, true>
221221
{
222-
typedef glm_i32vec4 type;
222+
using type = glm_i32vec4;
223223
};
224224

225225
template<>
@@ -229,7 +229,7 @@ namespace detail
229229
template<>
230230
struct storage<4, unsigned int, true>
231231
{
232-
typedef glm_u32vec4 type;
232+
using type = glm_u32vec4;
233233
};
234234
/* TODO: Duplicate ?
235235
template<>

glm/detail/setup.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ namespace glm
362362
{
363363
using std::size_t;
364364
# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
365-
typedef size_t length_t;
365+
using length_t = size_t;
366366
# else
367-
typedef int length_t;
367+
using length_t = int;
368368
# endif
369369
}//namespace glm
370370

@@ -376,15 +376,15 @@ namespace glm
376376
namespace glm{
377377
namespace detail
378378
{
379-
typedef std::int8_t int8;
380-
typedef std::int16_t int16;
381-
typedef std::int32_t int32;
382-
typedef std::int64_t int64;
379+
using int8 = std::int8_t;
380+
using int16 = std::int16_t;
381+
using int32 = std::int32_t;
382+
using int64 = std::int64_t;
383383

384-
typedef std::uint8_t uint8;
385-
typedef std::uint16_t uint16;
386-
typedef std::uint32_t uint32;
387-
typedef std::uint64_t uint64;
384+
using uint8 = std::uint8_t;
385+
using uint16 = std::uint16_t;
386+
using uint32 = std::uint32_t;
387+
using uint64 = std::uint64_t;
388388

389389
template<typename T>
390390
struct is_int
@@ -441,7 +441,7 @@ namespace detail
441441
};
442442
}//namespace detail
443443

444-
typedef unsigned int uint;
444+
using uint = unsigned int;
445445
}//namespace glm
446446

447447
///////////////////////////////////////////////////////////////////////////////////

glm/detail/type_float.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace detail
1818
template <>
1919
union float_t<float>
2020
{
21-
typedef int int_type;
22-
typedef float float_type;
21+
using int_type = int;
22+
using float_type = float;
2323

2424
GLM_CONSTEXPR float_t(float_type Num = 0.0f) : f(Num) {}
2525

@@ -41,8 +41,8 @@ namespace detail
4141
template <>
4242
union float_t<double>
4343
{
44-
typedef detail::int64 int_type;
45-
typedef double float_type;
44+
using int_type = detail::int64;
45+
using float_type = double;
4646

4747
GLM_CONSTEXPR float_t(float_type Num = static_cast<float_type>(0)) : f(Num) {}
4848

glm/detail/type_half.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace glm{
66
namespace detail
77
{
8-
typedef short hdata;
8+
using hdata = short;
99

1010
GLM_FUNC_DECL float toFloat32(hdata value);
1111
GLM_FUNC_DECL hdata toFloat16(float const& value);

glm/detail/type_mat2x2.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ namespace glm
1212
template<typename T, qualifier Q>
1313
struct mat<2, 2, T, Q>
1414
{
15-
typedef vec<2, T, Q> col_type;
16-
typedef vec<2, T, Q> row_type;
17-
typedef mat<2, 2, T, Q> type;
18-
typedef mat<2, 2, T, Q> transpose_type;
19-
typedef T value_type;
15+
using col_type = vec<2, T, Q>;
16+
using row_type = vec<2, T, Q>;
17+
using type = mat<2, 2, T, Q>;
18+
using transpose_type = mat<2, 2, T, Q>;
19+
using value_type = T;
2020

2121
private:
2222
col_type value[2];
2323

2424
public:
2525
// -- Accesses --
2626

27-
typedef length_t length_type;
27+
using length_type = length_t;
2828
GLM_FUNC_DECL static constexpr length_type length() { return 2; }
2929

3030
GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) noexcept;

glm/detail/type_mat2x3.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ namespace glm
1313
template<typename T, qualifier Q>
1414
struct mat<2, 3, T, Q>
1515
{
16-
typedef vec<3, T, Q> col_type;
17-
typedef vec<2, T, Q> row_type;
18-
typedef mat<2, 3, T, Q> type;
19-
typedef mat<3, 2, T, Q> transpose_type;
20-
typedef T value_type;
16+
using col_type = vec<3, T, Q>;
17+
using row_type = vec<2, T, Q>;
18+
using type = mat<2, 3, T, Q>;
19+
using transpose_type = mat<3, 2, T, Q>;
20+
using value_type = T;
2121

2222
private:
2323
col_type value[2];
2424

2525
public:
2626
// -- Accesses --
2727

28-
typedef length_t length_type;
28+
using length_type = length_t;
2929
GLM_FUNC_DECL static constexpr length_type length() { return 2; }
3030

3131
GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) noexcept;

glm/detail/type_mat2x4.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ namespace glm
1313
template<typename T, qualifier Q>
1414
struct mat<2, 4, T, Q>
1515
{
16-
typedef vec<4, T, Q> col_type;
17-
typedef vec<2, T, Q> row_type;
18-
typedef mat<2, 4, T, Q> type;
19-
typedef mat<4, 2, T, Q> transpose_type;
20-
typedef T value_type;
16+
using col_type = vec<4, T, Q>;
17+
using row_type = vec<2, T, Q>;
18+
using type = mat<2, 4, T, Q>;
19+
using transpose_type = mat<4, 2, T, Q>;
20+
using value_type = T;
2121

2222
private:
2323
col_type value[2];
2424

2525
public:
2626
// -- Accesses --
2727

28-
typedef length_t length_type;
28+
using length_type = length_t;
2929
GLM_FUNC_DECL static constexpr length_type length() { return 2; }
3030

3131
GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) noexcept;

glm/detail/type_mat3x2.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ namespace glm
1313
template<typename T, qualifier Q>
1414
struct mat<3, 2, T, Q>
1515
{
16-
typedef vec<2, T, Q> col_type;
17-
typedef vec<3, T, Q> row_type;
18-
typedef mat<3, 2, T, Q> type;
19-
typedef mat<2, 3, T, Q> transpose_type;
20-
typedef T value_type;
16+
using col_type = vec<2, T, Q>;
17+
using row_type = vec<3, T, Q>;
18+
using type = mat<3, 2, T, Q>;
19+
using transpose_type = mat<2, 3, T, Q>;
20+
using value_type = T;
2121

2222
private:
2323
col_type value[3];
2424

2525
public:
2626
// -- Accesses --
2727

28-
typedef length_t length_type;
28+
using length_type = length_t;
2929
GLM_FUNC_DECL static constexpr length_type length() { return 3; }
3030

3131
GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) noexcept;

glm/detail/type_mat3x3.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ namespace glm
1212
template<typename T, qualifier Q>
1313
struct mat<3, 3, T, Q>
1414
{
15-
typedef vec<3, T, Q> col_type;
16-
typedef vec<3, T, Q> row_type;
17-
typedef mat<3, 3, T, Q> type;
18-
typedef mat<3, 3, T, Q> transpose_type;
19-
typedef T value_type;
15+
using col_type = vec<3, T, Q>;
16+
using row_type = vec<3, T, Q>;
17+
using type = mat<3, 3, T, Q>;
18+
using transpose_type = mat<3, 3, T, Q>;
19+
using value_type = T;
2020

2121
private:
2222
col_type value[3];
2323

2424
public:
2525
// -- Accesses --
2626

27-
typedef length_t length_type;
27+
using length_type = length_t;
2828
GLM_FUNC_DECL static constexpr length_type length() { return 3; }
2929

3030
GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) noexcept;

0 commit comments

Comments
 (0)