Home | History | Annotate | Download | only in propagate_const.assignment
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // UNSUPPORTED: c++98, c++03, c++11
     11 
     12 // <propagate_const>
     13 
     14 // template <class U> propagate_const& propagate_const::operator=(U&&);
     15 
     16 #include <experimental/propagate_const>
     17 #include "propagate_const_helpers.h"
     18 #include <cassert>
     19 
     20 using std::experimental::propagate_const;
     21 
     22 int main() {
     23 
     24   typedef propagate_const<CopyConstructibleFromX> PY;
     25 
     26   X x1(1);
     27   PY p(2);
     28 
     29   assert(*p==2);
     30 
     31   p = x1;
     32 
     33   assert(*p==1);
     34 }
     35