Posts by rflobao • 101 points
1 post
-
0
votes1
answer98
viewsA: Reference return with possibility of invalid object
I can think of these two simple solutions. template<typename K, typename V> V *find(K key) { ... } int *v = find(key); if(v) ... Or template<typename K, typename V> bool find(K key, V…