-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Not sure about direct PR. Decided to make issue for discussion. Looks like current implementation doesn't allow to hold abstract types in value_ptr. Cloner and Deleters implies that it should be possible but value_or method breaks this possibility:
element_type value_or( U && v ) const
{
return has_value() ? value() : static_cast<element_type>(std::forward<U>( v ) );
}It implies that element_type should be able to construct from arbitrary type. For abstract types that's wrong expectation. What if "hide" value_or method under enable_if?
Metadata
Metadata
Assignees
Labels
No labels