operator<<(std::uniform_int_distribution), operator>>(std::uniform_int_distribution)
来自cppreference.com
< cpp | numeric | random | uniform int distribution
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| template< class CharT, class Traits, class ResultType > std::basic_ostream<CharT,Traits>& operator<<( std::basic_ostream<CharT,Traits>& ost, |
(1) | |
| template< class CharT, class Traits, class ResultType > std::basic_istream<CharT,Traits>& operator>>( std::basic_istream<CharT,Traits>& ist, |
(2) | |
执行流输入和输出操作的伪随机数分布
1) d.Original:
Performs stream input and output operations on pseudo-random number distribution
d.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
ost的文字表述写入一个文本表示的分布参数和内部状态。格式化标志和填充字符的ost是不变的.Original:
Writes a textual representation of the distribution parameters and internal state to
ost as textual representation. The formatting flags and fill character of ost are unchanged.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
的分布参数和内部状态恢复的数据读取
ist。 ist是不变的格式化标志。已写入的数据必须使用流具有相同的区域,CharTTraits模板参数,否则该行为是未定义的。如果遇到错误的输入,ist.setstate(std::ios::failbit)被调用,它可能会引发std::ios_base::failure。 d在这种情况下,是不变的.Original:
Restores the distribution parameters and internal state with data read from
ist. The formatting flags of ist are unchanged. The data must have been written using a stream with the same locale, CharT and Traits template parameters, otherwise the behavior is undefined. If bad input is encountered, ist.setstate(std::ios::failbit) is called, which may throw std::ios_base::failure. d is unchanged in that case.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 参数
| ost | - | 将数据插入到输出流
Original: output stream to insert the data to The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| ist | - | 输入的数据流中提取
Original: input stream to extract the data from The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| d | - | 分布的伪随机数
Original: pseudo-random number distribution The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[编辑] 返回值
1) ost
2) ist
[编辑] 例外
1)(无)
2) Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
可能会引发std::ios_base::failure上的糟糕输入.
Original:
may throw std::ios_base::failure on bad input.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.