-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rework a bunch of the *tructible concepts, Movable requires object types #66
Conversation
@@ -27,7 +27,7 @@ STL2_OPEN_NAMESPACE { | |||
concept bool _Is = _Valid<T, U, V...> && T<U, V...>::value; | |||
|
|||
template <class U, template <class...> class T, class...V> | |||
concept bool _IsNot = !_Is<U, T, V...>; | |||
concept bool _IsNot = _Valid<T, U, V...> && !T<U, V...>::value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yow, good catch.
|
||
template <class T, class U> | ||
concept bool Assignable() { | ||
return CommonReference<const T&, const U&>() && | ||
return Same<T, decay_t<T>&>() && | ||
CommonReference<const T&, const U&>() && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that T
is an lvalue reference type, const T&
is the same type as T
.
@@ -25,6 +25,10 @@ STL2_OPEN_NAMESPACE { | |||
template <class> | |||
constexpr bool __addressable = false; | |||
template <class T> | |||
constexpr bool __addressable<T&> = true; | |||
template <class T> | |||
constexpr bool __addressable<T&&> = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is right for Destructible
, but wrong for Addressable
: Addressable
needs to be changed to _Is<T, is_object> && __addressable<T>
. Destructible
need not subsume Addressable
, we can define it as:
namespace models {
template <class T>
constexpr bool Destructible = std::is_nothrow_destructible<T>::value && __addressable<T>;
}
template <class T>
concept bool Destructible() { return models::Destructible<T>; }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That definition of Destructible
changes the result from true
to false
for reference types. We don't want that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I misunderstood. You mean to leave the reference type specializations in for __addressable
. Got it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry about that.
c946f3e
to
a266238
Compare
a266238
to
8520289
Compare
...and ericniebler/stl2#313. |
...and ericniebler/stl2#300. |
...and caseycarter/stl2#22. |
Fixing a bunch of open issues with the low-level object concepts; namely, ericniebler/stl2#301, ericniebler/stl2#310, ericniebler/stl2#229, and ericniebler/stl2#70.