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 //===----------------------------------------------------------------------===//
8
9 // <random>
10
11 // template<class RealType = double>
12 // class student_t_distribution
13
14 // template <class CharT, class Traits, class RealType>
15 // basic_ostream<CharT, Traits>&
16 // operator<<(basic_ostream<CharT, Traits>& os,
17 // const student_t_distribution<RealType>& x);
18
19 // template <class CharT, class Traits, class RealType>
20 // basic_istream<CharT, Traits>&
21 // operator>>(basic_istream<CharT, Traits>& is,
22 // student_t_distribution<RealType>& x);
23
24 #include <random>
25 #include <sstream>
26 #include <cassert>
27
28 #include "test_macros.h"
29
main(int,char **)30 int main(int, char**)
31 {
32 {
33 typedef std::student_t_distribution<> D;
34 D d1(7);
35 std::ostringstream os;
36 os << d1;
37 std::istringstream is(os.str());
38 D d2;
39 is >> d2;
40 assert(d1 == d2);
41 }
42
43 return 0;
44 }
45