Advertisement
Guest User

Untitled

a guest
Jan 5th, 2019
24,956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <type_traits>
  2. #include <iostream>
  3.  
  4. template<unsigned NumCountries, unsigned NumSystems,
  5.          typename = typename std::enable_if<NumCountries == 2 &&
  6.                                             NumSystems == 2>::type>
  7. struct TaiwanConsensus {
  8.   static constexpr const char* Description
  9.     = "The vast majority of Taiwanese resolutely oppose "
  10.       "\"one country, two systems\"";
  11. };
  12.  
  13. int main() {
  14.   // Compilation Error!
  15.   // std::cout << TaiwanConsensus<1,1>::description << std::endl;
  16.   // std::cout << TaiwanConsensus<1,2>::description << std::endl;
  17.  
  18.   std::cout << TaiwanConsensus<2,2>::Description << std::endl;
  19.  
  20.   return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement