On Tuesday, 3 December 2019 at 07:12:18 UTC, Basile B. wrote:
I wish something like this was possible, until I change the
return type of `alwaysReturnNull` from `void*` to `auto`.
---
class A {}
class B {}
auto alwaysReturnNull() // void*, don't compile
{
writeln();
return null;
}
A
I wish something like this was possible, until I change the
return type of `alwaysReturnNull` from `void*` to `auto`.
---
class A {}
class B {}
auto alwaysReturnNull() // void*, don't compile
{
writeln();
return null;
}
A testA()
{
return alwaysReturnNull();
}
B testB()
{
On Sunday, 1 December 2019 at 14:42:46 UTC, Adam D. Ruppe wrote:
You can get the type at runtime by simply casting it...
if(auto c = cast(EventSocket) event) {
// is an event socket
}
Thanks.
I guess you need to be careful about which order you do those
tests so as not to cast to more