首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::valarray::cshift

valarray<T> cshift( int count ) const;

?

?

返回一个大小相同的新值数组,其位置由count元素。每个元素的新位置是%28i-计数%29 mod s,其中i是前一个位置,s是size()...

参数

count

-

number of positions to shift the elements by

返回值

结果的值数组具有循环移位的元素。

注记

函数的返回类型与std::valarray在这种情况下,替换类型具有以下属性:

  • const成员职能std::valarray提供。
  • std::valarray,,,std::slice_array,,,std::gslice_array,,,std::mask_arraystd::indirect_array可以从替换类型构造。
  • 所有接受类型参数的函数conststd::valarray&begin()end()%28,因为C++14%29也应该接受替换类型。
  • 接受两个类型参数的所有函数conststd::valarray&应该接受每一个组合conststd::valarray&以及替代型。
  • 返回类型不会在最嵌套的参数类型上添加两个以上的模板嵌套级别。

另见

shift

zero-filling shift the elements of the valarray (public member function)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com