Go to the documentation of this file.00001
00008 #ifndef FOR_HH
00009 #define FOR_HH
00010 #include<iostream>
00011 #include"array_mask.hh"
00012
00013 namespace mask{
00014
00015
00022 template<unsigned int M, unsigned int N>
00023 void print(){
00024 for(int i=0; i<N; i++){
00025 std::cout << (M>>i &1);
00026 }
00027 std::cout << std::endl;
00028 }
00029
00041 template<unsigned int I, unsigned int J, unsigned int N,unsigned int K>
00042 struct For{
00043 static void print(){
00044 mask::print<ArrayMask<N,K,I>::val, N>();
00045 For<I+1,J,N,K>::print();
00046 }
00047 };
00048
00050 template<unsigned int J, unsigned int N,unsigned int K>
00051 struct For<J,J,N,K>{
00052
00053 static void print(){
00054 mask::print<ArrayMask<N,K,J>::val, N>();
00055 }
00056 };
00057
00058 }
00059
00060 #endif //FOR_HH