Advertisement
Guest User

Untitled

a guest
Jan 25th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. namespace Family1
  2. {
  3.     struct ModelA{};
  4.     struct ModelB{};
  5. };
  6.  
  7. namespace Family2
  8. {
  9.     struct ModelC{};
  10. };
  11.  
  12. // valid for only classes in namespace Family1 only
  13. template<typename T>
  14. void Foo(T& _t ){}
  15.  
  16. Family1::ModelA modelA;
  17. Family2::ModelC modelC;
  18.  
  19. Foo<Family1::ModelA>( modelA );     // OK
  20. Foo<Family2::ModelC>( modelC );     // should cause a compile-time error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement