5 ms·
You can, if you abuse C++ enough. I needed this very thing for a custom DSL. struct PolyReturn { const int value; operator int() const { return
by pritambaral 2y ago
You can, if you abuse C++ enough. I needed this very thing for a custom DSL.
struct PolyReturn {
const int value;
operator int() const { return value; }
operator bool() const { return value > 0; }
};
https://cppinsights.io/s/f0b9976f https://cppinsights.io/s/f0b9976f