tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TestNoExplicitMoveConstructor.cpp (477B)


      1 class Foo {
      2  Foo(Foo&& f);
      3 };
      4 
      5 class Bar {
      6  explicit Bar(Bar&& f); // expected-error {{Move constructors may not be marked explicit}}
      7 };
      8 
      9 class Baz {
     10  template<typename T>
     11  explicit Baz(T&& f) {};
     12 };
     13 
     14 class Quxx {
     15  Quxx();
     16  Quxx(Quxx& q) = delete;
     17  template<typename T>
     18  explicit Quxx(T&& f) {};
     19 };
     20 
     21 void f() {
     22  // Move a quxx into a quxx! (This speciailizes Quxx's constructor to look like
     23  // a move constructor - to make sure it doesn't trigger)
     24  Quxx(Quxx());
     25 }