@@ -183,6 +183,39 @@ create private templated overloads of these members. — <i>end note</i>]
183
183
</p ></blockquote ></blockquote >
184
184
</blockquote >
185
185
186
+ <note >2014-02, Issaquah</note >
187
+ <p >
188
+ GR: want to prevent unsafe conversions. Standard is inconsistent how it does this. for <tt >reset()</tt > has deleted function
189
+ template capturing everything except the known-safe cases. Other functions use SFINAE. Main reason this is hard is that
190
+ <tt >unique_ptr</tt > supports fancy pointers. Have to figure out how to handle them and what requirements to put on them.
191
+ Requirements are minimal, not even required to work with <tt >pointer_traits</tt >.
192
+ <p />
193
+ STL surprised <tt >pointer_traits</tt > doesn't work
194
+ <p />
195
+ GR: ways to get fancy pointers to work is to delegate responsibility for preventing unsafe conversions to the fancy pointers themselves.
196
+ Howard doesn't like that, he wants even fancy pointers to be prevented from doing unsafe conversions in <tt >unique_ptr</tt > contexts.
197
+ <p />
198
+ AM: Howard says <tt >unique_ptr</tt > was meant to be very very safe under all conditions, this open a hole in that. Howard wants to
199
+ eke forward and support more, but not if we open any holes in type safety.
200
+ <p />
201
+ GR: do we need to be typesafe even for fancy types with incorrect <tt >pointer_traits</tt >?
202
+ <p />
203
+ AM: that would mean it's only unsafe for people who lie by providing a broken specialization of <tt >pointer_traits</tt >
204
+ <p />
205
+ GR: probably can't continue with ambiguity between using SFINAE and ill-formedness. Would appreciate guidance on direction used for that.
206
+ <p />
207
+ STL: difference is observable in convertibility using type traits.
208
+ <p />
209
+ STL: for <tt >reset()</tt > which doesn't affect convertibility ill-formed allows <tt >static_assert</tt >, better diagnostic.
210
+ For assignment it's detectable and has traits, constraining them is better.
211
+ <p />
212
+ EN: I strongly prefer constraints than <tt >static_asserts</tt >
213
+ <p />
214
+ STL: if we could rely on <tt >pointer_traits</tt > that might be good. Alternatively could we add more machinery to deleter?
215
+ make deleter say conversions are allowed, otherwise we lock down all conversions. basically want to know if converting <tt >U</tt > to
216
+ <tt >T</tt > is safe.
217
+ </p >
218
+
186
219
</discussion >
187
220
188
221
<resolution >
0 commit comments