• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // <fstream>
11 
12 // template <class charT, class traits = char_traits<charT> >
13 // class basic_ifstream
14 
15 // basic_ifstream(basic_ifstream&& rhs);
16 
17 #include <fstream>
18 #include <cassert>
19 
main()20 int main()
21 {
22 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
23     {
24         std::ifstream fso("test.dat");
25         std::ifstream fs = move(fso);
26         double x = 0;
27         fs >> x;
28         assert(x == 3.25);
29     }
30     {
31         std::wifstream fso("test.dat");
32         std::wifstream fs = move(fso);
33         double x = 0;
34         fs >> x;
35         assert(x == 3.25);
36     }
37 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
38 }
39