blob: e5ebdd5e628463b409ee6ba851b11bc2a5c1a393 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef TRACEIMPL_DERIVED_FROM_TEMPLATED_BASE_H_
#define TRACEIMPL_DERIVED_FROM_TEMPLATED_BASE_H_
#include "heap/stubs.h"
namespace blink {
class X : public GarbageCollected<X> {
public:
virtual void Trace(Visitor*) {}
};
template <int Y>
class TraceImplTemplatedBase
: public GarbageCollected<TraceImplTemplatedBase<Y> > {
public:
void Trace(Visitor* visitor) { TraceImpl(visitor); }
template <typename VisitorDispatcher>
void TraceImpl(VisitorDispatcher visitor) {
visitor->Trace(x_);
}
private:
Member<X> x_;
};
class TraceImplDerivedFromTemplatedBase : public TraceImplTemplatedBase<0> {
};
}
#endif // TRACEIMPL_DERIVED_FROM_TEMPLATED_BASE_H_
|