Created
October 12, 2018 09:53
-
-
Save carmel4a/b8cd8477255af2c0112be3cded47440f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace N | |
{ | |
template< class T > | |
foo( T& t ); | |
class Base | |
{ | |
int x; | |
int y; | |
}; | |
class A : Base | |
{ | |
int restA; | |
}; | |
class B : Base | |
{ | |
int restB; | |
}; | |
} | |
template< class T > | |
N::foo( T& t ) | |
{ | |
do_sth_with_t( t ); | |
if( ?? A ) | |
do_sth_with_t_member( t.x ); | |
else if ( ?? B ) | |
do_sth_with_t_member( t.y ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment