• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 template <typename>
6 class scoped_refptr {
7  public:
get()8   void* get() { return 0; }
9 };
10 
11 namespace base {
12 
13 template <typename Functor, typename... Args>
Bind(Functor &&,Args &&...)14 void Bind(Functor&&, Args&&...) {}
15 
16 }  // namespace base
17 
18 struct Foo {
19   void Bar();
20   static void Baz();
21 };
22 
Test()23 void Test() {
24   using base::Bind;
25   scoped_refptr<int> foo;
26   base::Bind(&Foo::Bar, foo.get());
27   Bind(&Foo::Bar, foo.get());
28   base::Bind(&Foo::Bar, (&foo)->get());
29   base::Bind(&Foo::Bar, foo.get(
30        ));
31   base::Bind(&Foo::Bar, foo
32        .get());
33   base::Bind(&Foo::Bar, foo.get(), foo.get());
34   base::Bind(&Foo::Baz, foo.get());
35   base::Bind(&Foo::Bar, foo.scoped_refptr<int>::get());
36   base::Bind(&Foo::Bar, (&foo)->scoped_refptr<int>::get());
37 }
38