AC
Size: a a a
AC
TS
TS
TS
#include <iostream>
template <class T>
struct has_operator_less
{
static char f(...);
template <class C>
static decltype(std::declval<C>().operator<(std::declval<C>()), int()) f(int);
static constexpr bool has = sizeof(f(0)) == sizeof(int);
};
struct S
{
bool operator<(const S & a) const { return this->field == a.field; }
int field = 0;
};
int main() {
std::cout << has_operator_less<S>::has;
return 0;
}
D
TS
D
В
#include <iostream>
template <class T>
struct has_operator_less
{
static char f(...);
template <class C>
static decltype(std::declval<C>().operator<(std::declval<C>()), int()) f(int);
static constexpr bool has = sizeof(f(0)) == sizeof(int);
};
struct S
{
bool operator<(const S & a) const { return this->field == a.field; }
int field = 0;
};
int main() {
std::cout << has_operator_less<S>::has;
return 0;
}
ip
try {
std::regex re("(\?([^#]*))?");
}
catch (const std::exception& e) {
std::cout << e.what() << '\n'; // Invalid special open parenthesis.
}
Что я не так делаю ?АВ
ip
АВ
АВ
ip
ip
АВ
"(\?([^#]*))?"
попробуй R"((\?([^#]*))?)"
ip
ip
АВ
АВ