[ create a new paste ] login | about

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

C++, pasted on Sep 2:
template<class T, class D, int K,int FuseLevel = 1, class Enable = void, class Enable1 = void>
struct LODPaintFunc
{
	inline static void Execute(T * controller, QGraphicsItem * item, QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
	{
	}
};
template<class D, class T,int FuseLevel>
struct LODPaintFunc<T,D,0,FuseLevel,typename boost::enable_if<IsRoute<T>>::type,typename boost::enable_if_c<(FuseLevel>=0)>::type>
{
	inline static void Execute(T * controller, QGraphicsItem * item, QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
	{
	}
};

template<class T, class D,int FuseLevel>
struct LODPaintFunc<T,D,1,FuseLevel,typename boost::enable_if<IsRoute<T>>::type,typename boost::enable_if_c<(FuseLevel>=0)>::type>
{
	inline static void Execute(T * controller, QGraphicsItem * item, QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
	{
                LODPaintFunc<T,D,0,FuseLevel-1>::Execute(controller, item, painter,option, widget);
				...
	}
};
template<class T, class D,int FuseLevel>
struct LODPaintFunc<T,D,2,FuseLevel,typename boost::enable_if<IsRoute<T>>::type,typename boost::enable_if_c<(FuseLevel>=0)>::type>
{
	inline static void Execute(T * controller, QGraphicsItem * item, QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
	{
                LODPaintFunc<T,D,0,FuseLevel-1>::Execute(controller, item, painter,option, widget);
                LODPaintFunc<T,D,1,FuseLevel-1>::Execute(controller, item, painter,option, widget);
				...
	}
};
template<class T, class D,int FuseLevel>
struct LODPaintFunc<T,D,3,FuseLevel,typename boost::enable_if<IsRoute<T>>::type,typename boost::enable_if_c<(FuseLevel>=0)>::type>
{
	inline static void Execute(T * controller, QGraphicsItem * item, QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
	{
                LODPaintFunc<T,D,0,FuseLevel-1>::Execute(controller, item, painter,option, widget);
                LODPaintFunc<T,D,1,FuseLevel-1>::Execute(controller, item, painter,option, widget);
                LODPaintFunc<T,D,2,FuseLevel-1>::Execute(controller, item, painter,option, widget);
				...
	}
};

{
... inside the actual code ...
LODPaintFunc<T,D,2>::Execute(controller, item, painter, option, widget);

}


Output:
1
2
Line 4: error: 'QGraphicsItem' has not been declared
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: