Skip to content
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

Merged
merged 1 commit into from
Jan 26, 2017

Conversation

ericniebler
Copy link
Collaborator

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.

@@ -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;
Copy link
Owner

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&>() &&
Copy link
Owner

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;
Copy link
Owner

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>; }

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry about that.

@ericniebler ericniebler force-pushed the constructible branch 2 times, most recently from c946f3e to a266238 Compare January 26, 2017 18:36
@CaseyCarter
Copy link
Owner

CaseyCarter commented Jan 26, 2017

Fixing a bunch of open issues

...and ericniebler/stl2#313.

@CaseyCarter CaseyCarter merged commit 6ec9162 into master Jan 26, 2017
@CaseyCarter CaseyCarter deleted the constructible branch January 26, 2017 22:17
@ericniebler
Copy link
Collaborator Author

...and ericniebler/stl2#300.

@CaseyCarter
Copy link
Owner

...and caseycarter/stl2#22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants