亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? hierarchygenerators.h

?? 和modern c++ design 這本書配套的程序庫。可以從作者的網(wǎng)站上免費下載。
?? H
字號:
////////////////////////////////////////////////////////////////////////////////
// The Loki Library
// Copyright (c) 2001 by Andrei Alexandrescu
// This code accompanies the book:
// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design 
//     Patterns Applied". Copyright (c) 2001. Addison-Wesley.
// Permission to use, copy, modify, distribute and sell this software for any 
//     purpose is hereby granted without fee, provided that the above copyright 
//     notice appear in all copies and that both that copyright notice and this 
//     permission notice appear in supporting documentation.
// The author or Addison-Welsey Longman make no representations about the 
//     suitability of this software for any purpose. It is provided "as is" 
//     without express or implied warranty.
////////////////////////////////////////////////////////////////////////////////

// Last update: March 05, 2001

#ifndef HIERARCHYGENERATORS_INC_
#define HIERARCHYGENERATORS_INC_

#include "Typelist.h"
#include "TypeTraits.h"
#include "EmptyType.h"

namespace Loki
{
////////////////////////////////////////////////////////////////////////////////
// class template GenScatterHierarchy
// Generates a scattered hierarchy starting from a typelist and a template
// Invocation (TList is a typelist, Model is a template of one arg):
// GenScatterHierarchy<TList, Model>
// The generated class inherits all classes generated by instantiating the 
// template 'Model' with the types contained in TList 
////////////////////////////////////////////////////////////////////////////////

    template <class TList, template <class> class Unit>
    class GenScatterHierarchy;
     
    template <class T1, class T2, template <class> class Unit>
    class GenScatterHierarchy<Typelist<T1, T2>, Unit>
        : public GenScatterHierarchy<T1, Unit>
        , public GenScatterHierarchy<T2, Unit>
    {
    public:
        typedef Typelist<T1, T2> TList;
        typedef GenScatterHierarchy<T1, Unit> LeftBase;
        typedef GenScatterHierarchy<T2, Unit> RightBase;
        template <typename T> struct Rebind
        {
            typedef Unit<T> Result;
        };
    };
     
    template <class AtomicType, template <class> class Unit>
    class GenScatterHierarchy : public Unit<AtomicType>
    {
        typedef Unit<AtomicType> LeftBase;
        template <typename T> struct Rebind
        {
            typedef Unit<T> Result;
        };
    };
    
    template <template <class> class Unit>
    class GenScatterHierarchy<NullType, Unit>
    {
        template <typename T> struct Rebind
        {
            typedef Unit<T> Result;
        };
    };
     
////////////////////////////////////////////////////////////////////////////////
// function template Field
// Accesses a field in an object of a type generated with GenScatterHierarchy
// Invocation (obj is an object of a type H generated with GenScatterHierarchy,
//     T is a type in the typelist used to generate H):
// Field<T>(obj)
// returns a reference to Unit<T>, where Unit is the template used to generate H 
////////////////////////////////////////////////////////////////////////////////

    template <class T, class H>
    typename H::Rebind<T>::Result& Field(H& obj)
    {
        return obj;
    }
     
    template <class T, class H>
    const typename H::Rebind<T>::Result& Field(const H& obj)
    {
        return obj;
    }
     
////////////////////////////////////////////////////////////////////////////////
// function template TupleUnit
// The building block of tuples 
////////////////////////////////////////////////////////////////////////////////

    template <class T>
    struct TupleUnit
    {
        T value_;
        operator T&() { return value_; }
        operator const T&() const { return value_; }
    };

////////////////////////////////////////////////////////////////////////////////
// class template Tuple
// Implements a tuple class that holds a number of values and provides field 
//     access to them via the Field function (below) 
////////////////////////////////////////////////////////////////////////////////

    template <class TList>
    struct Tuple : public GenScatterHierarchy<TList, TupleUnit>
    {
    };

////////////////////////////////////////////////////////////////////////////////
// helper class template FieldHelper
// See Field below
////////////////////////////////////////////////////////////////////////////////

    template <class H, unsigned int i> struct FieldHelper;
    
    template <class H>
    struct FieldHelper<H, 0>
    {
        typedef typename H::TList::Head ElementType;
        typedef typename H::Rebind<ElementType>::Result UnitType;
        
        enum
        {
            isTuple = Conversion<UnitType, TupleUnit<ElementType> >::sameType,
            isConst = TypeTraits<H>::isConst
        };

        typedef const typename H::LeftBase ConstLeftBase;
        
        typedef typename Select<isConst, ConstLeftBase, 
            typename H::LeftBase>::Result LeftBase;
            
        typedef typename Select<isTuple, ElementType, 
            UnitType>::Result UnqualifiedResultType;

        typedef typename Select<isConst, const UnqualifiedResultType,
                		UnqualifiedResultType>::Result ResultType;
            
        static ResultType& Do(H& obj)
        {
            LeftBase& leftBase = obj;
            return leftBase;
        }
    };

    template <class H, unsigned int i>
    struct FieldHelper
    {
        typedef typename TL::TypeAt<typename H::TList, i>::Result ElementType;
        typedef typename H::Rebind<ElementType>::Result UnitType;
        
        enum
        {
            isTuple = Conversion<UnitType, TupleUnit<ElementType> >::sameType,
            isConst = TypeTraits<H>::isConst
        };

        typedef const typename H::RightBase ConstRightBase;
        
        typedef typename Select<isConst, ConstRightBase, 
            typename H::RightBase>::Result RightBase;

        typedef typename Select<isTuple, ElementType, 
            UnitType>::Result UnqualifiedResultType;

        typedef typename Select<isConst, const UnqualifiedResultType,
                		UnqualifiedResultType>::Result ResultType;
            
        static ResultType& Do(H& obj)
        {
            RightBase& rightBase = obj;
            return FieldHelper<RightBase, i - 1>::Do(rightBase);
        }
    };

////////////////////////////////////////////////////////////////////////////////
// function template Field
// Accesses a field in an object of a type generated with GenScatterHierarchy
// Invocation (obj is an object of a type H generated with GenScatterHierarchy,
//     i is the index of a type in the typelist used to generate H):
// Field<i>(obj)
// returns a reference to Unit<T>, where Unit is the template used to generate H
//     and T is the i-th type in the typelist 
////////////////////////////////////////////////////////////////////////////////

    template <int i, class H>
    typename FieldHelper<H, i>::ResultType&
    Field(H& obj)
    {
        return FieldHelper<H, i>::Do(obj);
    }
        
//    template <int i, class H>
//    const typename FieldHelper<H, i>::ResultType&
//    Field(const H& obj)
//    {
//        return FieldHelper<H, i>::Do(obj);
//    }
        
////////////////////////////////////////////////////////////////////////////////
// class template GenLinearHierarchy
// Generates a linear hierarchy starting from a typelist and a template
// Invocation (TList is a typelist, Model is a template of two args):
// GenScatterHierarchy<TList, Model>
////////////////////////////////////////////////////////////////////////////////

    template
    <
        class TList,
        template <class AtomicType, class Base> class Unit,
        class Root = EmptyType
    >
    class GenLinearHierarchy;
    
    template
    <
        class T1,
        class T2,
        template <class, class> class Unit,
        class Root
    >
    class GenLinearHierarchy<Typelist<T1, T2>, Unit, Root>
        : public Unit< T1, GenLinearHierarchy<T2, Unit, Root> >
    {
    };

    template
    <
        class T,
        template <class, class> class Unit,
        class Root
    >
    class GenLinearHierarchy<Typelist<T, NullType>, Unit, Root>
        : public Unit<T, Root>
    {
    };

}   // namespace Loki

////////////////////////////////////////////////////////////////////////////////
// Change log:
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
////////////////////////////////////////////////////////////////////////////////

#endif // HIERARCHYGENERATORS_INC_

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国在线一区二区| 一区二区三区精密机械公司| 婷婷久久综合九色综合伊人色| 久久久亚洲精品一区二区三区| 精品一区二区三区免费播放| 精品久久99ma| 国产伦理精品不卡| 国产精品久久久久影院| 91视频com| 亚洲va天堂va国产va久| 日韩一区和二区| 国产黑丝在线一区二区三区| 国产精品免费视频观看| 色嗨嗨av一区二区三区| 首页国产丝袜综合| 久久综合色之久久综合| 波多野结衣一区二区三区| 一区二区三区中文在线观看| 欧美疯狂性受xxxxx喷水图片| 免费人成网站在线观看欧美高清| 久久精品在这里| 色欧美乱欧美15图片| 青青国产91久久久久久| 国产色综合久久| 欧美三级日韩三级国产三级| 国产在线一区观看| 成人欧美一区二区三区白人 | 日本不卡不码高清免费观看| 日韩精品一区二区三区三区免费| 国产精品 欧美精品| 一区二区三区四区在线免费观看| 欧美一区在线视频| 成人免费观看av| 日本美女一区二区| 中文字幕一区二区三区在线观看 | 欧美日韩极品在线观看一区| 捆绑调教一区二区三区| 亚洲视频一二区| 日韩精品一区二区三区swag| 日本乱码高清不卡字幕| 精久久久久久久久久久| 成人av集中营| 蜜臀a∨国产成人精品| 亚洲天堂免费看| 日韩午夜精品视频| 91久久免费观看| 成人污视频在线观看| 老汉av免费一区二区三区| 亚洲一级片在线观看| 中文字幕欧美日韩一区| 欧美大片拔萝卜| 欧美日韩亚洲高清一区二区| 99精品国产一区二区三区不卡| 久久国产成人午夜av影院| 一区二区三区成人| 国产精品人人做人人爽人人添 | 精品成人一区二区三区| 欧洲一区二区三区在线| 成人激情免费网站| 国产精品一线二线三线| 日韩不卡在线观看日韩不卡视频| 亚洲精品菠萝久久久久久久| 国产精品女同一区二区三区| 久久综合网色—综合色88| 91精品国产色综合久久不卡电影| 在线观看一区不卡| 91蝌蚪porny成人天涯| 成人午夜视频网站| 成人午夜在线播放| 国产成人精品影视| 成人免费视频免费观看| 国产成人免费xxxxxxxx| 国产福利一区在线| 国产精华液一区二区三区| 极品少妇xxxx精品少妇偷拍| 视频在线观看一区二区三区| 亚洲成人免费av| 午夜不卡av免费| 日韩中文字幕麻豆| 日av在线不卡| 久久精品国产澳门| 国产麻豆视频一区二区| 国产成人a级片| 国产91精品入口| 99久久精品免费看| 欧美主播一区二区三区美女| 欧美影院一区二区三区| 欧美人狂配大交3d怪物一区| 欧美顶级少妇做爰| 精品福利av导航| 国产欧美精品国产国产专区| 国产精品久久久久久久蜜臀| 亚洲人吸女人奶水| 亚洲成人综合视频| 琪琪一区二区三区| 91.麻豆视频| 欧美tickling挠脚心丨vk| 久久综合九色综合欧美亚洲| 中文字幕欧美日本乱码一线二线| 国产精品久久久久一区二区三区 | 精品国产一区二区三区不卡 | 国产高清视频一区| 波多野结衣在线一区| 91福利国产精品| 日韩欧美在线一区二区三区| 久久一区二区三区四区| 国产精品黄色在线观看| 亚洲国产成人porn| 国产精品综合av一区二区国产馆| 91一区二区在线观看| 欧美精选午夜久久久乱码6080| 日韩精品在线一区| 国产精品久久久久桃色tv| 亚洲成年人网站在线观看| 久久国产尿小便嘘嘘尿| av亚洲精华国产精华精华| 欧美美女直播网站| 久久精品在线观看| 亚洲国产精品久久一线不卡| 国产一区二区剧情av在线| 91小宝寻花一区二区三区| 日韩一区二区在线观看视频| 中文无字幕一区二区三区 | 日韩经典中文字幕一区| 国产精品1区2区3区| 欧美午夜一区二区三区| 久久久久久久久蜜桃| 亚洲成年人网站在线观看| 成人一区二区视频| 日韩欧美高清在线| 一区二区三区四区中文字幕| 国产一区视频导航| 欧美精品一二三四| 亚洲私人影院在线观看| 韩国成人福利片在线播放| 欧美性猛交xxxx乱大交退制版| ww亚洲ww在线观看国产| 午夜精品一区二区三区三上悠亚| 丁香天五香天堂综合| 日韩一区二区三| 亚洲国产精品综合小说图片区| 国产成人亚洲精品狼色在线| 欧美日本一区二区| 亚洲欧洲成人av每日更新| 国产伦精品一区二区三区视频青涩| 欧美日韩国产中文| 亚洲欧美经典视频| 成人国产一区二区三区精品| 欧美成人性战久久| 日韩中文字幕一区二区三区| 欧美午夜精品免费| 成人激情小说乱人伦| 久久综合九色综合97婷婷| 视频一区二区中文字幕| 欧美在线高清视频| 亚洲最大成人网4388xx| 91小视频在线观看| 国产精品色哟哟网站| 成人一级视频在线观看| 国产欧美日韩久久| 精品一区二区三区免费毛片爱| 欧美一区二区视频观看视频| 亚洲影视在线播放| 色婷婷综合中文久久一本| 最新国产精品久久精品| 成人黄色网址在线观看| 国产精品视频一二| 福利91精品一区二区三区| 久久色成人在线| 国产精品18久久久久久久久| 久久久久久电影| 丁香桃色午夜亚洲一区二区三区| 久久久久久一二三区| 国产精品一区二区在线播放| 久久久99精品免费观看不卡| 国产乱子伦一区二区三区国色天香| 精品久久久久一区二区国产| 精品亚洲免费视频| 久久久久久久久久久99999| 国产麻豆精品95视频| 国产精品美女久久久久久久网站| 国产成人一级电影| 综合久久久久久| 欧美在线短视频| 久久99精品久久久久婷婷| 国产亚洲欧洲997久久综合| 成人激情校园春色| 亚洲自拍偷拍综合| 欧美一区二区私人影院日本| 激情亚洲综合在线| 国产精品国产三级国产aⅴ入口| 色久优优欧美色久优优| 五月婷婷综合网| 欧美精品一区二区三区蜜臀| 成人性生交大合| 亚洲成人免费在线观看| 婷婷成人激情在线网| 国产亚洲人成网站| 欧美色精品在线视频| 激情偷乱视频一区二区三区|