Quantcast
Channel: User Filip Milovanović - Software Engineering Stack Exchange
Viewing all articles
Browse latest Browse all 116

Comment by Filip Milovanović on Implementing factory that return the correct type

$
0
0
If it's not a requirement, don't go through CreateBase. Now you basically have two distinct roots to your inheritance graph, so maybe it's better to think about the Base and the Interface types as two distinct starting points. The only possible classes that work here are F2 and B1, so just try F2 first, then B1, and if that fails, return nullptr (the same way you do for Foo & Bar).

Viewing all articles
Browse latest Browse all 116

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>