[ create a new paste ] login | about

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

C++, pasted on Mar 17:
#include <cassert>  
#include <iostream>  
#include <stdexcept>  
#include <string>  

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
Line 31: error: expected identifier before '...' token
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: