#pragma once namespace sp { namespace option { // Provide static numeric ID, to facilitate implementation of GetIdImpl() template struct StaticNumIdImpl {}; // Facilitate implementation of DispatchImpl() template struct DispatchImpl {}; // Provide fields of the message, facilitate implementation of // ReadImpl(), WriteImpl(), ValidImpl(), etc... template struct FieldsImpl {}; } // namespace option namespace details { template class MessageImplParsedOptions; template <> struct MessageImplParsedOptions<> { static const bool HasStaticNumIdImpl = false; static const bool HasDispatchImpl = false; static const bool HasFieldsImpl = false; }; template struct MessageImplParsedOptions, TOptions...> : public MessageImplParsedOptions { static const bool HasStaticNumIdImpl = true; static const std::intmax_t MsgId = TId; }; template struct MessageImplParsedOptions, TOptions...> : public MessageImplParsedOptions { static const bool HasDispatchImpl = true; using ActualMessage = TActual; }; template struct MessageImplParsedOptions, TOptions...> : public MessageImplParsedOptions { static const bool HasFieldsImpl = true; using Fields = TFields; }; } // namespace details } // namespace sp