fork(1) download
  1. #include <iostream>
  2. #include <type_traits>
  3. using namespace std;
  4.  
  5. struct arch32 {};
  6. struct arch64 {};
  7.  
  8. template<typename Arch>
  9. struct header_traits;
  10.  
  11. template<>
  12. struct header_traits<arch32>
  13. {
  14. using VirtualAddress_type = uint32_t;
  15. };
  16.  
  17. template<>
  18. struct header_traits<arch64>
  19. {
  20. using VirtualAddress_type = uint64_t;
  21. };
  22.  
  23. /// skiped more lines
  24.  
  25. template<typename Arch>
  26. using VirtualAddress_t = typename header_traits<Arch>::VirtualAddress_type;
  27.  
  28. int main() {
  29. // your code goes here
  30.  
  31. VirtualAddress_t<arch32> t;
  32. static_assert(is_same<VirtualAddress_t<arch32>, uint32_t>::value, "not same");
  33.  
  34. return 0;
  35. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty