optional is "is_copy_constructible" when T is not.
- Dominant language
- C++
- Stars
- 60
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
Hi.
I encountered issues while trying to use std::vector>>. THis failed to compile on msvc.
Looks like it boiled down to this repro: https://godbolt.org/g/cFNcUN
```
#include
#include
#include
struct NonCopyAble
{
NonCopyAble() = default;
NonCopyAble(const NonCopyAble&) = delete;
NonCopyAble& operator=(const NonCopyAble&) = delete;
NonCopyAble(NonCopyAble&&) = default;
NonCopyAble& operator=(NonCopyAble&&) = default;
};
static_assert(!std::is_copy_constructible::value, "NonCopyAble is_copy_constructible when shouldn't be");
static_assert(!std::is_copy_constructible>::value, "std::optional is_copy_constructible when shouldn't be");
static_assert(!std::is_copy_constructible>::value, "boost::optional is_copy_constructible when shouldn't be"); // This assert fails
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.