[ create a new paste ] login | about

Link: http://codepad.org/s8fa4OyZ    [ raw code | output | fork ]

C++, pasted on Mar 17:
#include <stdarg.h>  
#include <cassert>  
#include <iostream>  
#include <stdexcept>  
#include <string>  
#include <initializer_list>  
using namespace std;

#define LENGTH 10   
#define WIDTH  5
#define NEWLINE '\n'

namespace detail
   {
       template<int Is>
       struct seq { };

       template<int N, int Is>
       struct gen_seq : gen_seq<N - 1, Is> { };

       template<int Is>
       struct gen_seq<0, Is> : seq<Is> { };

       template<int Is>
       void for_each( seq<Is>)
       {
           cout<<Is<<endl;
       }
   }

template<class... Types>
void perform_account_maintenance(std::tuple<Types...> helpers)
{
      detail::for_each(detail::gen_seq<sizeof...(Types)>());
}

int main()
{

   int a=1; float f=0.1;
 perform_account_maintenance( std:tie(a,f));
   return 0;
}


Output:
1
2
3
4
Line 21: error: stdarg.h: No such file or directory
Line 29: error: initializer_list: No such file or directory
Line 31: error: expected identifier before '...' token
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: