Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to understand complicated C++ template declaration?

I came across some complicated C++ template declarations in a project. Here is an example:

template<template<uint TElementSize, uint TQueueSize, class TAdditionalData> class InternalQueue, uint QueueSize, bool RandomSelect = false>
struct PerProcedureQueueTyping 
{
    template<class ProcedureInfo>
        class Type : public PerProcedureVersatileQueue<ProcedureInfo, InternalQueue, QueueSize, InternalQueue, QueueSize, RandomSelect> {}; 
};

I have two questions:
1. How to understand this declaration and what is the intention of it? Especially, what does the nested template<uint TElementSize, uint TQueueSize, class TAdditionalData> on the top stand for?
2. Why need to wrap an empty class definition in the struct PerProcedureQueueTyping definition?

Looking forward to your help.

Comments