动态阵列的状态是什么? [英] What is the status on dynarrays?

查看:224
本文介绍了动态阵列的状态是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

gcc 4.9 现在支持 n3696(具有自动存储持续时间的运行时大小的数组) n3662 说:


N3497 运行时大小的数组与自动存储
持续时间,Jens Maurer提出具有运行时绑定的数组。这些数组
是std :: dynarray,因为正常的固定大小的数组是std :: array。


邮寄名单,Jonathan Wakely说:


我们应该向手册添加一个C ++ 14状态表,但是在此期间
这里是库状态的快速摘要。



...



这些缺少:




  • N3672建议添加实用程序类来表示可选对象

  • N3655 TransformationTraits Redux

  • N3662 C ++动态数组

  • N3644 Null Forward Iterators



特征一个简单但有点乏味,迭代器一个
可能只影响调试模式,但其他两个是大量的
件工作。


但是,n3662还说:


我们建议
为数组定义一个新的设备,而不是采用C可变长度数组
b $ b。我们称这些动态数组为dynarray。


我似乎找不到 dynarray gcc 页面上使用快速CTRL + F。因此 dynarray 即将实现,并且可变长度数组保持或将消失?

解决方案

std :: dynarray 打算和c ++ 14一起使用。但是,后来决定将 std :: dynarray 移动到Array TS,它也可能包括一些 std :: array_view 类。主要原因是委员会在一些情况下(确保堆栈分配不像我们想象的那么容易)在堆分配和堆栈分配方面没有达成一致。因此,决定将推迟。仍然有一些不断讨论应该做什么。



类不会为C ++ 14做好准备。

更新: std :: dynarray

code>不在C ++ 14中,不会在C ++ 17中,数组TS已经停止,因此可能不会有任何接近 std :: dynarray 在标准之前。如果我理解标准的当前位置正确,而不是神奇的运行时大小的数组,委员会宁愿想出一个通用的解决方案,为runtie大小的类,但迄今为止的每一个建议都被拒绝。


gcc 4.9 now has support for n3696 (Runtime-sized arrays with automatic storage duration). n3662 says:

In N3497 Runtime-sized arrays with automatic storage duration, Jens Maurer proposes arrays with runtime bound. These arrays are to std::dynarray as normal fixed-size arrays are to std::array.

In this mailing list, Jonathan Wakely says:

We should add a C++14 status table to the manual but in the meantime here's a quick summary of the library status.

...

These ones are missing:

  • N3672 A proposal to add a utility class to represent optional objects
  • N3655 TransformationTraits Redux
  • N3662 C++ Dynamic Arrays
  • N3644 Null Forward Iterators

The traits one is simple but a bit tedious and the iterators one probably only affects debug mode, but the other two are substantial pieces of work. Is anyone planning on working on or yet?

However, n3662 also says:

Instead of adopting C variable-length arrays we propose to define a new facility for arrays where the number of elements is bound at construction. We call these dynamic arrays, dynarray.

I can't seem to find dynarray using a quick CTRL+F on the gcc pages. So is dynarray going to be implemented soon, and will variable length arrays stay or will it disappear?

解决方案

std::dynarray was intended to go with c++14 at first. However, it was later decided that std::dynarray would be moved to an "Array TS" which may also include some std::array_view class. The main reason is that the committee did not agree on some points concerning heap-allocation versus stack-allocation in some cases (ensuring stack-allocation is not as easy as one could think). Therefore, it was decided that it would be delayed. There are still some ungoing discussions about what should be done.

The class won't be ready for C++14. It will probably come with the Arrays TS or C++17.

Update: std::dynarray wasn't in C++14, won't be in C++17, the Arrays TS has been discontinued, so there probably won't be anything close to std::dynarray in the standard before long. If I understand the current position of the standard correctly, rather than magical runtime-sized arrays, the committee would rather come up with a general solution for runtie-sized classes, but every suggestion so far has been rejected.

这篇关于动态阵列的状态是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆