fork(2) download
  1. #include <iostream>
  2. #include <chrono>
  3. using namespace std;
  4.  
  5. template<class T>
  6. struct C {
  7. T t_;
  8. C() {}
  9. template<class U> C(const C<U>&) {}
  10. template<typename T2> constexpr explicit C(const T2& t) : t_(t) {}
  11. };
  12.  
  13. using Z = chrono::milliseconds;
  14. using S = C<long>;
  15.  
  16. void foo(Z) {}
  17. void bar(S s) { cout << s.t_ << endl; }
  18.  
  19. struct A {
  20. static const unsigned t1 = 123;
  21. };
  22. int main() {
  23. foo(Z(A::t1));
  24. bar(S(A::t1));
  25. }
  26.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
123