Code: Select all
struct Foo
{
operator int&() { return bar; }
int bar{42};
};
void fuz()
{
Foo foo;
auto& baz{static_cast(foo)}; // Works
const auto& biz{static_cast(foo)}; // Works
auto& buz{static_cast(foo)}; //Code: Select all
struct Foo
{
operator int&() { return bar; }
int bar{42};
};
void fuz()
{
Foo foo;
auto& baz{static_cast(foo)}; // Works
const auto& biz{static_cast(foo)}; // Works
auto& buz{static_cast(foo)}; //