Loki header files now all have consistent include statement style.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1069 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2010-04-19 03:09:59 +00:00
parent ae4fbd418d
commit 6bc2851497
16 changed files with 773 additions and 773 deletions

View file

@ -2,14 +2,14 @@
// The Loki Library
// Copyright (c) 2001 by Andrei Alexandrescu
// This code accompanies the book:
// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
// 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 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-Wesley Longman make no representations about the
// suitability of this software for any purpose. It is provided "as is"
// The author or Addison-Wesley Longman make no representations about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
////////////////////////////////////////////////////////////////////////////////
#ifndef LOKI_HIERARCHYGENERATORS_INC_
@ -18,14 +18,14 @@
// $Id$
#include "Typelist.h"
#include "TypeTraits.h"
#include "EmptyType.h"
#include <loki/Typelist.h>
#include <loki/TypeTraits.h>
#include <loki/EmptyType.h>
namespace Loki
{
#if defined(_MSC_VER) && _MSC_VER >= 1300
#pragma warning( push )
#pragma warning( push )
// 'class1' : base-class 'class2' is already a base-class of 'class3'
#pragma warning( disable : 4584 )
#endif // _MSC_VER
@ -35,27 +35,27 @@ namespace Loki
// Generates a scattered hierarchy starting from a typelist and a template
// Invocation (TList is a typelist, Unit is a template of one arg):
// GenScatterHierarchy<TList, Unit>
// The generated class inherits all classes generated by instantiating the
// template 'Unit' with the types contained in TList
// The generated class inherits all classes generated by instantiating the
// template 'Unit' with the types contained in TList
////////////////////////////////////////////////////////////////////////////////
namespace Private
{
// The following type helps to overcome subtle flaw in the original
// implementation of GenScatterHierarchy.
// The flaw is revealed when the input type list of GenScatterHierarchy
// contains more then one element of the same type (e.g. LOKI_TYPELIST_2(int, int)).
// In this case GenScatterHierarchy will contain multiple bases of the same
// The following type helps to overcome subtle flaw in the original
// implementation of GenScatterHierarchy.
// The flaw is revealed when the input type list of GenScatterHierarchy
// contains more then one element of the same type (e.g. LOKI_TYPELIST_2(int, int)).
// In this case GenScatterHierarchy will contain multiple bases of the same
// type and some of them will not be reachable (per 10.3).
// For example before the fix the first element of Tuple<LOKI_TYPELIST_2(int, int)>
// is not reachable in any way!
template<class, class>
template<class, class>
struct ScatterHierarchyTag;
}
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<Private::ScatterHierarchyTag<T1, T2>, Unit>
@ -71,10 +71,10 @@ namespace Loki
typedef Unit<T> Result;
};
};
// In the middle *unique* class that resolve possible ambiguity
template <class T1, class T2, template <class> class Unit>
class GenScatterHierarchy<Private::ScatterHierarchyTag<T1, T2>, Unit>
class GenScatterHierarchy<Private::ScatterHierarchyTag<T1, T2>, Unit>
: public GenScatterHierarchy<T1, Unit>
{
};
@ -88,7 +88,7 @@ namespace Loki
typedef Unit<T> Result;
};
};
template <template <class> class Unit>
class GenScatterHierarchy<NullType, Unit>
{
@ -97,14 +97,14 @@ namespace Loki
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
// returns a reference to Unit<T>, where Unit is the template used to generate H
////////////////////////////////////////////////////////////////////////////////
template <class T, class H>
@ -112,16 +112,16 @@ namespace Loki
{
return obj;
}
template <class T, class H>
const typename H::template Rebind<T>::Result& Field(const H& obj)
{
return obj;
}
////////////////////////////////////////////////////////////////////////////////
// function template TupleUnit
// The building block of tuples
// The building block of tuples
////////////////////////////////////////////////////////////////////////////////
template <class T>
@ -134,8 +134,8 @@ namespace Loki
////////////////////////////////////////////////////////////////////////////////
// class template Tuple
// Implements a tuple class that holds a number of values and provides field
// access to them via the Field function (below)
// Implements a tuple class that holds a number of values and provides field
// access to them via the Field function (below)
////////////////////////////////////////////////////////////////////////////////
template <class TList>
@ -149,13 +149,13 @@ namespace Loki
////////////////////////////////////////////////////////////////////////////////
template <class H, unsigned int i> struct FieldHelper;
template <class H>
struct FieldHelper<H, 0>
{
typedef typename H::TList::Head ElementType;
typedef typename H::template Rebind<ElementType>::Result UnitType;
enum
{
isTuple = Conversion<UnitType, TupleUnit<ElementType> >::sameType,
@ -163,16 +163,16 @@ namespace Loki
};
typedef const typename H::LeftBase ConstLeftBase;
typedef typename Select<isConst, ConstLeftBase,
typedef typename Select<isConst, ConstLeftBase,
typename H::LeftBase>::Result LeftBase;
typedef typename Select<isTuple, ElementType,
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;
@ -185,7 +185,7 @@ namespace Loki
{
typedef typename TL::TypeAt<typename H::TList, i>::Result ElementType;
typedef typename H::template Rebind<ElementType>::Result UnitType;
enum
{
isTuple = Conversion<UnitType, TupleUnit<ElementType> >::sameType,
@ -193,16 +193,16 @@ namespace Loki
};
typedef const typename H::RightBase ConstRightBase;
typedef typename Select<isConst, ConstRightBase,
typedef typename Select<isConst, ConstRightBase,
typename H::RightBase>::Result RightBase;
typedef typename Select<isTuple, ElementType,
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;
@ -217,7 +217,7 @@ namespace Loki
// 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
// and T is the i-th type in the typelist
////////////////////////////////////////////////////////////////////////////////
template <int i, class H>
@ -226,14 +226,14 @@ namespace Loki
{
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
@ -248,7 +248,7 @@ namespace Loki
class Root = EmptyType
>
class GenLinearHierarchy;
template
<
class T1,
@ -283,7 +283,7 @@ namespace Loki
};
#if defined(_MSC_VER) && _MSC_VER >= 1300
#pragma warning( pop )
#pragma warning( pop )
#endif
} // namespace Loki