LOKI library reading - adds to Typelist: Floor base class, recent base class, type sort

zhaozj2021-02-16  42

Compared to the Typelist source code, the following code is still very simple, there is not much to say nonsense.

#ifndef typefelist_add_h # define Typelist_add_h

/ / -------------------------------------------------------------------------------------------- ------------------------------- // LOKI library ourselves compile under DEVCPP, the version provided by LOKIVC6Port . / / -------------------------------------------------------------------------------------------- ------------------------------- # Define supersubclass_strict_fix (t, u) / (supersubclass (t, u) && /! :: LOKI :: Conversion :: sametype) // ----------------------------- -------------------------------------------------- / / -------------------------------------------------------------------------------------------- ------------------------------ Template struct millbased;

Template Struct MostBased {typedef t result;};

template struct MostBased , T> {private: typedef typename MostBased :: Result Candidate; public: typedef typename Select :: result result;

/ / -------------------------------------------------------------------------------------------- ------------------------- // ----------------------- -------------------------------------------------- Template struct nearestbased;

Template struct nearestbasedhelper;

template struct NearestBasedHelper , T, CurNearBase> {private: typedef typename Select :: Result curnearbase; // search in class public between two classes: typedef typename NearestBasedHelper :: Result Result;}; template struct NearestBasedHelper {typedef curnearbase result;}; template // protects the empty Typelist action. Struct nearestBased {// typedef t result;

Template struct nearestbased , t> {private: typedef MostBased , t> :: results, Then clam the method. Public: typedef typename nearestbasedhelper , t, momtbased> :: result result;

/ / -------------------------------------------------------------------------------------------- ------------------------------ // After the order is complete, the derived class must be in front of its base class. / / -------------------------------------------------------------------------------------------- ------------------------------ Template struct sort;

Template <> struct sort {typedef nulltype result;

template struct Sort > {private: typedef typename MostDerived :: Result TheMostDerived; typedef typename Replace :: Result L; public : TypeDef Typelist :: result> result;}; # ENDIF

转载请注明原文地址:https://www.9cbs.com/read-26710.html

New Post(0)