std::is_convertible has no defined behavior when its arguments
are incomplete, even if they are equal. In practice, it returns false.
Adding std::is_same allows us to use the constructor using a callable,
even if the return value is incomplete. We also check the case where
we convert a T into a const T.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
- Since you're replacing an OR chain you need to re-implement std::disjunction, not std::conjunction (no s at the end), which you mostly did, except for the name and the (2).
- According to the specification std::disjunction should return std::false_type for an empty argument list. I.e. here you should use std::false_type instead:
template <typename... Conds> struct conjunctions : std::true_type {};
Also please add a couple of tests for your llvm::disjunction implementation to llvm/unittests/Support/TypeTraitsTest.cpp.
Comment Actions
Oh yes, thanks for that!
I realized that there was also already a llvm::disjunction in ADT/STLForwardCompat.h, so I used it.