[MIR][NFC] Use `std::move` to avoid copying (#125930)
[llvm-project.git] / libcxx / test / std / numerics / rand / rand.dist / rand.dist.norm / rand.dist.norm.chisq / io.pass.cpp
blob0294ff52ea3574d59d2406c851cc5c73cb6e6866
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-localization
11 // <random>
13 // template<class RealType = double>
14 // class chi_squared_distribution
16 // template <class CharT, class Traits, class RealType>
17 // basic_ostream<CharT, Traits>&
18 // operator<<(basic_ostream<CharT, Traits>& os,
19 // const chi_squared_distribution<RealType>& x);
21 // template <class CharT, class Traits, class RealType>
22 // basic_istream<CharT, Traits>&
23 // operator>>(basic_istream<CharT, Traits>& is,
24 // chi_squared_distribution<RealType>& x);
26 #include <random>
27 #include <sstream>
28 #include <cassert>
30 #include "test_macros.h"
32 int main(int, char**)
35 typedef std::chi_squared_distribution<> D;
36 D d1(7);
37 std::ostringstream os;
38 os << d1;
39 std::istringstream is(os.str());
40 D d2;
41 is >> d2;
42 assert(d1 == d2);
45 return 0;