主要喜欢他的语法着色功能,真的很方便,RSS等方面的功能也很全面......

测试一下:

/**///////////////////////////////
//Prime.cpp

/**///////////////////////////////
template<int Val>
struct IntType


{
const static int value = Val ;
};
template<bool flag, typename T, typename U>
struct Select


{
typedef T Result;
};

template<typename T, typename U>
struct Select<false, T, U>


{
typedef U Result;
};
template <unsigned int N,unsigned int x>
struct FindRoot


{
const static int value=Select<(N/x)==x||((N/x+x)/2==x),IntType<x>,FindRoot<N,(N/x+x)/2> >::Result::value;
};

template <unsigned int N>
struct Sqrt


{
const static int value=FindRoot<N,N/2>::value;
};

template <>
struct Sqrt<0> ;

template <int N,int divider>
struct TestPrime


{
const static int value=Select<(N%divider)==0,IntType<0>,TestPrime<N,divider-1> >::Result::value;
};

template <int N>
struct TestPrime<N,1>


{
const static int value=1;
};

template <unsigned int N>
struct IsPrime


{
const static int value=TestPrime<N,Sqrt<N>::value+1>::value;
};

template <>
struct IsPrime<2>


{
const static int value=1;
};

template <>
struct IsPrime<1>;

int printf(const char*,
);

int main()


{
const int yes=IsPrime<123127>::value;
printf("%d\n",yes);
}
