libcxx initial import
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <random>
|
||||
|
||||
// class bernoulli_distribution
|
||||
|
||||
// template <class charT, class traits>
|
||||
// basic_ostream<charT, traits>&
|
||||
// operator<<(basic_ostream<charT, traits>& os,
|
||||
// const bernoulli_distribution& x);
|
||||
//
|
||||
// template <class charT, class traits>
|
||||
// basic_istream<charT, traits>&
|
||||
// operator>>(basic_istream<charT, traits>& is,
|
||||
// bernoulli_distribution& x);
|
||||
|
||||
#include <random>
|
||||
#include <sstream>
|
||||
#include <cassert>
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef std::bernoulli_distribution D;
|
||||
D d1(.25);
|
||||
std::ostringstream os;
|
||||
os << d1;
|
||||
std::istringstream is(os.str());
|
||||
D d2;
|
||||
is >> d2;
|
||||
assert(d1 == d2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user