Comment Re:the best. (Score 1) 553
How is this not beautiful:
template<class S1, class S2> struct cartesian_product_types
{
template<class V, class S, class State>
struct inner
{
typedef typename boost::mpl::fold<S
, State
, boost::mpl::push_back< boost::mpl::_1
, std::pair<V
,boost::mpl::_2
>
>
>::type type;
};
typedef typename boost::mpl::fold<S1
, boost::mpl::vector<>
, inner<boost::mpl::_2, S2, boost::mpl::_1>
>::type type;
};
But seriously, I think the language is amazing. The fact that they built a turing-complete language inside the template engine essentially by accident (thus allowing meta programming and modern C++), the fact that by now we can write simple compile time compilers (see boost proto) and the fact that you can so radically change the syntax of the language that you can basically make it look like anything you want should convince someone who spends some time with a C++ compiler and a couple of Boost libraries of this fact.
template<class S1, class S2> struct cartesian_product_types
{
template<class V, class S, class State>
struct inner
{
typedef typename boost::mpl::fold<S
, State
, boost::mpl::push_back< boost::mpl::_1
, std::pair<V
,boost::mpl::_2
>
>
>::type type;
};
typedef typename boost::mpl::fold<S1
, boost::mpl::vector<>
, inner<boost::mpl::_2, S2, boost::mpl::_1>
>::type type;
};
But seriously, I think the language is amazing. The fact that they built a turing-complete language inside the template engine essentially by accident (thus allowing meta programming and modern C++), the fact that by now we can write simple compile time compilers (see boost proto) and the fact that you can so radically change the syntax of the language that you can basically make it look like anything you want should convince someone who spends some time with a C++ compiler and a couple of Boost libraries of this fact.