I found that some CppCon speakers used and instead of && to define concepts and used && in "normal" boolean expressions, but I can’t figure out the benefits of doing so.
The only material about naming convensions of concepts that I can found is P1851: Guidelines For snake_case Concept Naming, but it says nothing about this.
Can anyone tell me why?
Example:
template <typename T>
concept boolean_testable
= std::convertible_to<T, bool>
and requires(T&& t) {
{ !std::forward<T>(t) } -> std::convertible_to<bool>;
};
Instead of:
template <typename T>
concept boolean_testable
= std::convertible_to<T, bool>
&& requires(T&& t) {
{ !std::forward<T>(t) } -> std::convertible_to<bool>;
};
>Solution :
There is absolutely no difference between && and and. As tokens they behave identically in all respects expect that the preprocessor # stringify operator respects their different spelling.
For example you can even replace T&& with T and and the code will still have identical meaning.
This is purely a style choice.
See [lex.digraph].