-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathChangeLog
More file actions
227 lines (151 loc) · 8.38 KB
/
ChangeLog
File metadata and controls
227 lines (151 loc) · 8.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
* Support for "import std;" is enabled by defining the macro
STRONG_TYPE_IMPORT_STD_LIBRARY. This has currently only been
tested on MSVC with C++20 and C++23. Other compilers may or
may not work at this point. You can also run the unit-tests
with "import std;" by adding the CMake option
-DSTRONG_TYPE_IMPORT_STD_LIBRARY=yes
Huge thangs to David Hunter for contributing this addition.
* Make strong::range work with range types that only has
const_iterator types (e.g. std::set). Thanks David Feltell for
reporting the problem.
v15 2024-07-07
* CMake package is now ARCH_INDEPENDENT, as it should be when it's
header only. Thank you Patrick Kappl for submitting the fix.
* Much reworked strong::range, which is now compatible with
std::ranges. This was primarily sparked by a discussion with
Harald Achitz. Thank you for bringing up the deficiencies.
v14 2024-03-05
* Added several missing [[nodiscard]]
* .begin() and .end() are now constexpr for strong::range types. Thanks
Harald Achitz for reporting the missing specifiers.
* Added .size() member to strong::range types, if the underlying type
has a .size() member. Thanks Harald Achitz for the suggestion.
v13 2023-11-29
* Added static_assert() messages explaining why a modifier cannot be
used with an underlying type. Thank you SilmaliTech for suggesting
the improvement.
* Added modifier `invocable` for types with operator(). Thank you
Dominic Koepke for the suggestion and the draft implementation.
v12 2023-07-20
* Fixed a bug where fmt formatter function was not const, as it must be
per the documentation. Thank you Tim Blechmann for submitting the
fix.
* Strong types can be weakly_ordered, strongly_ordered and
partially_ordered, using operator <=> in C++20 and later. Huge thanks
to Björn Schäpers and Tim Blechmann for the suggestions, discussions
and infinite patience.
v11 2023-05-02
* A strong type can now be used as an NTTP (Non Type Template Parameter)
using type = strong::type<int, struct int_>;
template <type t>
struct S {
constexpr operator int() const { return value_of(t);}
};
int main()
{
S<type{3}> obj;
return obj;
}
Thank you Toni Neubert for the implementation.
v10 2023-02-03
* Corrected the test for, and use of, concepts when specializing
std::numeric_limits<> for strong::arithmetic types. Thank you
Björn Schäpers for reporting.
v9 2023-01-23
* Lowered the minimum required CMake version to 3.7, unless unit-tests
are built.
* A type predicate strong::type_is_v<type, modifier> has been introduced.
It can be used in compile time tests for generic code to ensure that
a strong type has the necessary modifiers. Example:
using type = strong::type<int, struct type_,
strong::ordered,
strong::ordered_with<int, long>>;
static_assert(strong::type_is_v<type, strong::ordered>);
static_assert(strong::type_is_v<type, strong::ordered_with<long>>);
Note that for variadic modifiers like strong::ordered_with<>, the
predicate ensures that all types listed in the test are supported,
so in the example above, the test type_is_v<type, ordered_with<long>>
is true because 'long' is included in the type definition using
ordered_with<int, long>.
There's also a type version, to use as
strong::is_type<type, modifier>::value;
* std::numeric_limits<T> is specialized for types using the
strong::arithmetic modifier.
* Added missing const&& overloads for value_of()
v8 2023-01-04
* Split the header file into one file for each modifier. This can
in some cases speed up compilation times considerably. The header
file <strong_type/strong_type.hpp> still includes everything, so
no changes to existing code is necessary.
* Added new modifier scalable_with<Ts...>. Allows multiplication and
division with each of the types Ts. If the underlying type can be
divided, the result will be the first of the type in Ts.
* difference types are conditionally ordered, if the underlying type
supports it. Previously they were always ordered, but e.g. a 2D
vector on a plane is a useful difference type, but it is usually
not ordered. This change allows the vector in 2D space to be used
as a difference type.
* Add Cmake alias target strong_type::strong_type
* Use the CMake option -DSTRONG_TYPE_UNIT_TEST=yes to build unit tests
v7 2022-12-22
* Added missing #include for <fmt/ostream.h>. Thank you Björn Schäpers
* Fixed MSVC check (typo) for constexpr. Thank you Sergei Soloviev
* Builds cleanly with -Wconversion
* Strengthened the unit test suite and CI build structure
v6 2022-10-21
* Added missing strong::is_ostreamable<> predicate needed for fmtlib 9.
Thank you Tim Blechman @timblechmann for submitting the fix.
v5 2022-10-20
* Fixed issue #22, a regression with strong::formattable and fmtlib.
A type that is strong::ostreamable can be formatted with fmt. A
type that is both strong::formattable and strong::ostreamable will
use the type's formatter<> when using fmt. The behaviour of
std::format is unchanged.
* strong::arithmetic no longer specializes std::is_arithmetic<>. Issue
#19. This is expressively disallowed by the standard and is undefined
behaviour. Sorry for this potentially breaking change, but it was
always wrong.
v4 2021-08-16
* strong::affine_point<D> can now be defaulted as
strong::affine_point<>, in which case a difference type will be
generated using the same tag as the strong affine point type.
* operator% is now conditionally supported for arithmetic types,
provided that the underlying type supports the operation.
* operator% is also conditionally supported for difference types,
difference % difference => underlying type, and
difference % underlying type => difference.
* strong::difference is now strong::equality comparable in addition
to being strong::ordered
v3 2021-08-02
* increment/decrement operators are now hidden friends
* swap() is now constexpr. Thanks Björn Schäpers @HazardyKnusperkeks
* operator() is now noexcept if the underlying type has a
noexcept operator (). Thanks Björn Schäpers @HazardyKnusperkeks
* Fixed bug where clang++ on Windows wrongly used MSVC work-arounds
* Fixed bug where non-const operator[] returned const&
* Use github-actions for CI
v2 2020-07-13
* Fixed strong::underlying_type<T> for CRTP defined strong type T
* Added strong::ordered_with<Ts...> for cross-type ordering
relations.
* Added strong::equality_with<Ts...> for cross-type equality
comparison operators.
* Added strong::unique modifier for creating move-only types
v1 2020-07-11
* Moved to Boost Software License (BSL) 1.0 license
* Added convertible_to<Ts...> and implicitly_convertible_to<Ts...>
modifiers.
* Added strong::uninitialized for when you *want* to create a
variable with unitialized value. Unlike the built in types,
this is explicitly visible at the site of use.
* Moved many namespace scope functions as inline friends to
avoid ADL issues.
* Added strong::semiregular and strong::regular since they are
such frequently seen good defaults.
* Many internal improvements and compiler bug work-arounds.
* Added strong::iterator and strong::range modifiers.
* More noexcept() specifiers
* Removed strong::unique and strong::scoped. They are different
beasts that don't feel quite at home here. Thanks Adi Shavit.
0.0.1 2017-09-30
* First announcement