fork download
  1. #include <vector>
  2. #include <string>
  3. #include <iostream>
  4. #include <iomanip>
  5.  
  6. using namespace std;
  7.  
  8. constexpr auto p = std::make_pair(1, 2);
  9.  
  10.  
  11. template<const std::pair<int, int>& pr>
  12. void zoo()
  13. {
  14. constexpr int a = pr.first;
  15. }
  16.  
  17. constexpr auto foo(const std::pair<int, int>& pr)
  18. {
  19. int a = pr.first;
  20. return a;
  21. }
  22.  
  23. constexpr auto goo(std::pair<int, int> pr)
  24. {
  25. int a = pr.first;
  26. return a;
  27. }
  28.  
  29. constexpr auto x = foo(p);
  30. constexpr auto y = goo(p);
  31.  
  32. int main(int argc, const char * argv[])
  33. {
  34. zoo<p>();
  35. }
  36.  
  37.  
  38.  
Success #stdin #stdout 0s 4288KB
stdin
Standard input is empty
stdout
Standard output is empty