fork(47) download
  1. #include <iostream>
  2. #include <utility>
  3. #include <type_traits>
  4.  
  5. #define __(A,B,C,...) B##C##A
  6. #define _(A,...) __(__VA_ARGS__, A)
  7. template<unsigned...Is> struct v;
  8. template<unsigned I0, unsigned... Is> struct v<I0, Is...>:v<I0-1,I0-1, Is...> {};
  9. template<unsigned...Is> struct v<0,Is...>:std::integral_constant<unsigned, sizeof...(Is)> {};
  10.  
  11. int main() {
  12. std::cout << "Hello world from line " << v<_(EXTRACT,_(Q,_,E,_,$$main$$,),_(@22,,_,_),_(Z,N,L,I,_,,L),__STACK_TRACE__)>::value << "\n";
  13. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Hello world from line 12