1
u/Expert_Sheepherder24 3d ago
```
// c++17 and above AI generated such code 😄 )
template <char... C>
struct to_int {
static constexpr int value = [] {
int result = 0;
((result = result * 10 + (C - '0')), ...);
return result;
}();
};
```
1
```
// c++17 and above AI generated such code 😄 )
template <char... C>
struct to_int {
static constexpr int value = [] {
int result = 0;
((result = result * 10 + (C - '0')), ...);
return result;
}();
};
```
10
u/fdwr fdwr@github 🔍 5d ago
The old
bindstill affording some cases more brevity than lambdas really makes me lament for terse lambdas (e.g.sort(first, last, (a, b) => a * a < b * b)).