Is there a way to make the following code not so bloated?
I mean join both type and a reference somehow (|| does not work).
template<typename T>
concept IntegralVector = std::integral<typename T::value_type> &&
requires(T t)
{
{ t.size() } -> std::convertible_to<std::size_t>;
}
&& (requires(T t)
{
{ t[0] } -> std::same_as<typename T::value_type&>;
} || requires(T t)
{
{ t[0] } -> std::same_as<typename T::value_type>;
});
A working trick can be:
{ 0 + t[0] } -> std::integral;
But I want to stick with typename T::value_type