~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to JavaScriptCore/wtf/TypeTraits.h

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-02-04 19:30:57 UTC
  • mfrom: (1.2.8 upstream) (4.3.9 sid)
  • Revision ID: james.westby@ubuntu.com-20100204193057-d3018lm1fipb0703
* New upstream release
* debian/copyright:
- Updated with changes since 1.1.19.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 /*
2
2
 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3
 
 * Copyright (C) 2009 Google Inc. All rights reserved.
 
3
 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
4
4
 *
5
5
 * This library is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU Library General Public
104
104
        static const bool value = true;
105
105
    };
106
106
 
 
107
    template <typename T, typename U> class IsSubclass {
 
108
        typedef char YesType;
 
109
        struct NoType {
 
110
            char padding[8];
 
111
        };
 
112
 
 
113
        static YesType subclassCheck(U*);
 
114
        static NoType subclassCheck(...);
 
115
        static T* t;
 
116
    public:
 
117
        static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType);
 
118
    };
 
119
 
 
120
    template <typename T, template<class V> class U> class IsSubclassOfTemplate {
 
121
        typedef char YesType;
 
122
        struct NoType {
 
123
            char padding[8];
 
124
        };
 
125
 
 
126
        template<typename W> static YesType subclassCheck(U<W>*);
 
127
        static NoType subclassCheck(...);
 
128
        static T* t;
 
129
    public:
 
130
        static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType);
 
131
    };
 
132
 
 
133
    template <typename T, template <class V> class OuterTemplate> struct RemoveTemplate {
 
134
        typedef T Type;
 
135
    };
 
136
 
 
137
    template <typename T, template <class V> class OuterTemplate> struct RemoveTemplate<OuterTemplate<T>, OuterTemplate> {
 
138
        typedef T Type;
 
139
    };
 
140
 
107
141
    template <typename T> struct RemoveConst {
108
142
        typedef T Type;
109
143
    };