[Bug c++/101137] std::conjunction result error

2021-06-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101137

Jonathan Wakely  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #5 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #3)
> I think the problem is a simple typo in your is_signed_integral_convert_copy
> trait, you use boost::mp11::mp_first>
> ^
> 
> Presumably that's supposed to be boost::mp11::mp_first>.

So not a bug.
   ^

[Bug c++/101137] std::conjunction result error

2021-06-21 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101137

--- Comment #4 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #3)
> template
> concept SignedIntegralRef1
>   = std::is_lvalue_reference_v && SignedIntegral1;

Oops, that should be
std::is_lvalue_reference_v && SignedIntegral1>
(which is easy to spot when you break the wall of text into pieces).

It's irrelevant here anyway, because you can never have a type like
deque, so it would make a lot more sense for your code to have separate
concepts as above, and then for the the concepts like Container you only need
to use the SignedIntegral1 concept, because the container's value type can't be
a reference.

N.B. defining traits just to use as arguments to std::conjunction just to
define concepts is ... peculiar.

Why not just define the concepts directly? It will compile much faster.

template
concept ContainerOfSignedIntegral
  = Container && SignedIntegral;

template
concept SignedIntegralConvertCopy1
  = ContainerOfSignedIntegral && !ForwardList
&& ContainerOfSignedIntegral
&& (!std::same_as);

template
concept SignedIntegralConvertCopy = (SignedIntegralConvertCopy1 &&
...);

[Bug c++/101137] std::conjunction result error

2021-06-21 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101137

--- Comment #3 from Jonathan Wakely  ---
I get the same behaviour if I replace all uses of std::conjunction with fold
expressions and split up your unreadable long lines into simpler atoms (which
also makes the code much simpler) e.g.

template
concept SignedIntegral1 = std::is_integral_v && std::is_signed_v;

template
concept SignedIntegralRef1
  = std::is_lvalue_reference_v && SignedIntegral1;


template
concept SignedIntegral
  = ((SignedIntegral1 || SignedIntegralRef1) && ...);



I think the problem is a simple typo in your is_signed_integral_convert_copy
trait, you use boost::mp11::mp_first>
^

Presumably that's supposed to be boost::mp11::mp_first>.
  ^

[Bug c++/101137] std::conjunction result error

2021-06-21 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101137

--- Comment #2 from Jonathan Wakely  ---
And ideally, remove everything not relevant to the bug.

[Bug c++/101137] std::conjunction result error

2021-06-21 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101137

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed||2021-06-21
 Ever confirmed|0   |1
 Status|UNCONFIRMED |WAITING

--- Comment #1 from Jonathan Wakely  ---
This is hundreds of lines of code (170kloc preprocessed) that produces 527
lines of output.

Could you at least point us to the relevant part, so we don't have to read and
analyze the entire thing?