https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100475

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to 康桓瑋 from comment #4)
> (In reply to 康桓瑋 from comment #3)
> > Also, the operator->() simply uses operator& instead of std::__addressof.
> > 
> > https://godbolt.org/z/zfGnEoePG

Good catch, thanks.

> 
> Another issue is that the has_value() of this specialization will always
> return true, which will make the precondition
> __glibcxx_assert(_M_pred.has_value()) for filter_view's begin() almost
> useless.

That's fine I suppose, the assert will just be a no-op in that case.

> 
> Although it is not clear why semiregular-box is partial specialization in
> gcc-11, it is obvious that this needs to be treated with care.

The advantage of the partial specialization is that it's space-optimal whereas
the primary template is not, due to its use of std::optional.

Reply via email to