Skip to content

Instantly share code, notes, and snippets.

@dmikushin
Created January 10, 2015 13:20
Show Gist options
  • Save dmikushin/7e7e77a0a98e3bebe2d8 to your computer and use it in GitHub Desktop.
Save dmikushin/7e7e77a0a98e3bebe2d8 to your computer and use it in GitHub Desktop.
C++11 compilation case
template<class PriorityEvaluation, class TProcInfo>
class ProcInfoWithPriority : public TProcInfo
{
};
template<class TProcInfo, class TCustom = void>
class ProcInfoVisitor
{
};
// Iterators to construct ProcInfo for current Phase only
template< template<class /*TTProc*/, int /*Phase*/> class TPhaseTraits, class NextOrig, int Phase, bool MatchPhase>
struct PhaseProcInfoInter;
template<class Priority, template<class /*TTProc*/, int /*Phase*/> class TPhaseTraits, class ProcedureInfoOrig, int Phase, bool MatchPhase>
struct PhaseProcInfo;
template<class Priority, template<class /*TTProc*/, int /*Phase*/> class TPhaseTraits, class ProcedureInfoOrig, int Phase>
struct PhaseProcInfo<Priority, TPhaseTraits, ProcedureInfoOrig, Phase, true> : public ProcInfoWithPriority<Priority, PhaseProcInfoInter<TPhaseTraits, ProcedureInfoOrig, Phase, true > >
{
//static void tell()
//{
// printf("PhaseProcInfoUse(%d)->", ProcedureInfoOrig::Procedure::myid);
// PhaseProcInfoInter<TPhaseTraits, ProcedureInfoOrig, Phase, true > ::tell();
//}
};
// Iterator to construct queues for all phases
template<template<class /*ProcedureInfo*/> class InternalQueue, class ProcedureInfo, int Phase, int NumPhases>
struct PhaseQueues
{
template<class TProc, int Phase_>
class MyPhaseTraits : public ProcedureInfo:: template PhaseTraits<TProc, Phase_ > { };
typedef PhaseProcInfo<
typename ProcedureInfo:: template Priority<Phase>,
MyPhaseTraits,
ProcedureInfo,
Phase,
ProcedureInfo:: template PhaseTraits<typename ProcedureInfo::Procedure,Phase>::Active > TProcInfo;
};
int main()
{
return 0;
}
# g++ -std=c++11 test.cpp -o test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment