@cella-lang/cpp 0.1.202611070006 → 0.1.202611070815
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +37 -0
- package/cpp.arrays.cell +0 -0
- package/cpp.cell +0 -0
- package/cpp.classes.cell +0 -0
- package/cpp.classrules.cell +0 -0
- package/cpp.construction.cell +0 -0
- package/cpp.constructs.cell +0 -0
- package/cpp.copies.cell +0 -0
- package/cpp.exceptions.cell +0 -0
- package/cpp.inheritance.cell +0 -0
- package/cpp.lambdas.cell +0 -0
- package/cpp.layouts.cell +0 -0
- package/cpp.library.algorithms.cell +0 -0
- package/cpp.library.bitsets.cell +0 -0
- package/cpp.library.cell +0 -0
- package/cpp.library.comparisons.cell +0 -0
- package/cpp.library.deques.cell +0 -0
- package/cpp.library.iterators.cell +0 -0
- package/cpp.library.lists.cell +0 -0
- package/cpp.library.maps.cell +0 -0
- package/cpp.library.numerics.cell +0 -0
- package/cpp.library.pairs.cell +0 -0
- package/cpp.library.queues.cell +0 -0
- package/cpp.library.sets.cell +0 -0
- package/cpp.library.stacks.cell +0 -0
- package/cpp.library.strings.cell +0 -0
- package/cpp.library.trees.cell +0 -0
- package/cpp.library.tuples.cell +0 -0
- package/cpp.library.unorderedmaps.cell +0 -0
- package/cpp.library.vectors.cell +0 -0
- package/cpp.memberpointers.cell +0 -0
- package/cpp.names.cell +0 -0
- package/cpp.objects.cell +0 -0
- package/cpp.operators.cell +0 -0
- package/cpp.overloading.cell +0 -0
- package/cpp.polymorphism.cell +0 -0
- package/cpp.primitives.cell +0 -0
- package/cpp.ranges.cell +0 -0
- package/cpp.references.cell +0 -0
- package/cpp.runtimetypes.cell +0 -0
- package/cpp.standardexceptions.cell +0 -0
- package/cpp.standardfunctions.cell +0 -0
- package/cpp.staticmembers.cell +0 -0
- package/cpp.streams.cell +0 -0
- package/cpp.templates.cell +0 -0
- package/cpp.userconversions.cell +0 -0
- package/index.json +1249 -1181
- package/package.json +4 -4
package/CHANGES.md
CHANGED
|
@@ -5,6 +5,43 @@
|
|
|
5
5
|
|
|
6
6
|
## 未發佈
|
|
7
7
|
|
|
8
|
+
- **之前判 unknown、現在判 accept**:元素是類別的可變長度陣列(GNU 的擴充;`P a[n];`、`std::string b[n];`、`std::vector<int> adj[n];`,
|
|
9
|
+
`n` 從輸入讀)。之前判 unknown(`unsupported`,"a variable length array of objects of a class")。現在照 clang/g++ 執行:元素照索引
|
|
10
|
+
逐一預設建構,離開時反序解構,建構子丟出時已建好的反序解構;判決帶假設 `{"implementation":"gcc","choice":"vla"}`(和純量的
|
|
11
|
+
VLA 相同)。長度 0 或負數判 reject(和純量的相同)。多維(`P a[n][2]`)仍判 unknown("a variable length array of arrays of objects
|
|
12
|
+
of a class")。
|
|
13
|
+
- **之前判 reject、現在判 accept**:沒有使用者宣告建構子的類別用 `new` 建,照 [dcl.init]——
|
|
14
|
+
`new Node()` 值初始化(成員是零,有預設成員初始化子的照它;`struct Node { int v; Node* next; }` 的連結串列讀 `h->v` 印 0,
|
|
15
|
+
之前 `indeterminate value`);`new Node(n)` 用隱含的複製建構子逐成員複製(含基底子物件、陣列成員,從衍生類別的物件取基底
|
|
16
|
+
部分;之前 `indeterminate value` 或 `no matching constructor`)。暫時物件 `Q()`(有預設成員初始化子或虛擬函式的類別)也先
|
|
17
|
+
零初始化。`new Node` 照舊不初始化:讀成員判 reject(`indeterminate value`)。
|
|
18
|
+
- **新的語意樹節點 `eNewList`**(見 `@cella-lang/cfamily`):`new T{…}` 照 [dcl.init.list]——聚合體逐成員(巢狀大括號給基底與
|
|
19
|
+
陣列成員,沒列到的成員是預設成員初始化子或零)、有建構子的類別選建構子、純量一個元素(`new int{5}`)、`new T{}` 值初始化;
|
|
20
|
+
元素窄化(`new Node{1.5, nullptr}`)與多出的項判 reject(clang++ 不編譯)。判 unknown:initializer_list 建構子的串列
|
|
21
|
+
(`new vector<int>{1, 2, 3}`)、建構子引數裡的巢狀大括號、指定初始化子、聚合體裡有建構子或解構子的成員。
|
|
22
|
+
- `T(std::move(x))`、`new T(std::move(x))`:宣告了移動操作的類別交給移動建構子(之前暫時物件逐位元複製、不跑使用者的移動建構子)。
|
|
23
|
+
- `Constructor`(類別表的建構子)多一欄 `implicit : Bool`(類別沒有宣告的:需要的預設建構子、逐成員的複製或移動建構子)。
|
|
24
|
+
⚠️ 不相容:`Constructor` 的記錄字面量要多寫 `implicit`。
|
|
25
|
+
- **之前判 unknown、現在判 accept**:容器的範圍版本收任何輸入迭代器(C++17 [sequence.reqmts] 的序列容器要求表)——`vector` 的
|
|
26
|
+
`insert(p, i, j)`(回傳第一個插入的位置)與 `assign(i, j)`,`string` 的 `append(i, j)`、`assign(i, j)`、`insert(p, i, j)`,
|
|
27
|
+
`deque` 的 `assign(i, j)`。範圍可以是指標(`buf.insert(buf.end(), a, mid)`,a 是陣列)、另一個容器的迭代器(vector、set、
|
|
28
|
+
deque),元素型別可以不同。之前判 unknown「the model's 'std::vector<int>' has no overload of 'insert' for these arguments」。
|
|
29
|
+
元素的複製、移動、指派、解構與容量照 libc++(`capacity()` 照舊附假設 `vector.growth`)。
|
|
30
|
+
- **之前判 unknown、現在判 reject(`ubLib`,函式庫引數的未定義行為)**:範圍是容器自己的迭代器(`v.insert(v.end(), v.begin(),
|
|
31
|
+
v.begin() + 1)`、`v.assign(v.end(), v.end())`、`d.assign(d.begin() + 1, d.end())`;要求表的前置條件),範圍的兩端倒過來
|
|
32
|
+
(`v.insert(v.end(), a + 3, a)`)。libc++ 不檢查(clang 照常結束),標準說未定義。string 的範圍可以是自己的字元
|
|
33
|
+
(標準把它們定成先做出 `basic_string(i, j)`),照常 accept。deque 的範圍指向自己只在範圍不空時判。
|
|
34
|
+
- 沒變(照舊 unknown):範圍建構子 `vector(i, j)`、`string(i, j)`、`deque(i, j)`(要建構子樣板,模型還沒有);string 的計數
|
|
35
|
+
版本;`deque::insert`。兩個整數的寫法(`v.assign(3, 7)`)選計數的版本,不會選到範圍版本(算術型別與列舉不參加多載,
|
|
36
|
+
[sequence.reqmts]p14)。
|
|
37
|
+
- 模型的樣板特徵多 `std::is_arithmetic_v`、`std::is_enum_v`(預設樣板引數裡的 `std::enable_if_t<!std::is_arithmetic_v<T>>`)。
|
|
38
|
+
- **之前判 unknown(step limit reached)、現在照常判**:類別樣板的成員函式樣板(`template <class T> struct Box { template <class It>
|
|
39
|
+
void put(It a, It b) {...} }; Box<int> b; b.put(a, a + 3);`)。之前呼叫要的實例找不到(只在類別樣板實例化之前的項目裡找),
|
|
40
|
+
一直重試到步數用完;程式自己的類別樣板與函式庫的(上面的範圍版本)都是。
|
|
41
|
+
- **之前判 unknown(ubPtrOrder)、現在判 accept**:空的 vector 的 `insert(v.begin(), x)`、`erase(v.begin(), v.end())`。位置的
|
|
42
|
+
前置條件改用 `==` 與「指向區塊之內」問(空的 vector 的區塊是 null,之前用 `<` 比兩個 null 被當成跨物件的比較)。
|
|
43
|
+
- `vector::insert(p, n, x)`、`vector::assign(n, x)`(計數的版本)新增;`assign(n, x)` 的 x 是自己的元素判 reject(`ubLib`,要求表的前置條件)。
|
|
44
|
+
|
|
8
45
|
- **之前判 reject、現在判 accept**(0.1.202611061934 的退步):型別只由推導得到的類別樣板實例(`auto t = make_tuple(1, 2, 3); auto [a, b, c] = t;`),函式定義當下也看得到([temp.inst]p2:隱式實例化在需要的地方就完整)。之前判 reject「a structured binding needs an array, a struct or a class」。用名字定義、在函式之後才定義的類別照舊判 reject。
|
|
9
46
|
- **新增 `cpp.verdictReport`**(和 `cpp.verdict` 同參數、同型別):判決的 JSON 原封不動,最後多一個 `"steps": N`——這次執行用掉
|
|
10
47
|
的模型步數(單位同 fuel;fuel 用完時等於 fuel;沒跑到執行的是 0)。同一個版本、程式、輸入,在每個宿主上相同。`cpp.verdict`
|
package/cpp.arrays.cell
CHANGED
|
Binary file
|
package/cpp.cell
CHANGED
|
Binary file
|
package/cpp.classes.cell
CHANGED
|
Binary file
|
package/cpp.classrules.cell
CHANGED
|
Binary file
|
package/cpp.construction.cell
CHANGED
|
Binary file
|
package/cpp.constructs.cell
CHANGED
|
Binary file
|
package/cpp.copies.cell
CHANGED
|
Binary file
|
package/cpp.exceptions.cell
CHANGED
|
Binary file
|
package/cpp.inheritance.cell
CHANGED
|
Binary file
|
package/cpp.lambdas.cell
CHANGED
|
Binary file
|
package/cpp.layouts.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.bitsets.cell
CHANGED
|
Binary file
|
package/cpp.library.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.deques.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.lists.cell
CHANGED
|
Binary file
|
package/cpp.library.maps.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.pairs.cell
CHANGED
|
Binary file
|
package/cpp.library.queues.cell
CHANGED
|
Binary file
|
package/cpp.library.sets.cell
CHANGED
|
Binary file
|
package/cpp.library.stacks.cell
CHANGED
|
Binary file
|
package/cpp.library.strings.cell
CHANGED
|
Binary file
|
package/cpp.library.trees.cell
CHANGED
|
Binary file
|
package/cpp.library.tuples.cell
CHANGED
|
Binary file
|
|
Binary file
|
package/cpp.library.vectors.cell
CHANGED
|
Binary file
|
package/cpp.memberpointers.cell
CHANGED
|
Binary file
|
package/cpp.names.cell
CHANGED
|
Binary file
|
package/cpp.objects.cell
CHANGED
|
Binary file
|
package/cpp.operators.cell
CHANGED
|
Binary file
|
package/cpp.overloading.cell
CHANGED
|
Binary file
|
package/cpp.polymorphism.cell
CHANGED
|
Binary file
|
package/cpp.primitives.cell
CHANGED
|
Binary file
|
package/cpp.ranges.cell
CHANGED
|
Binary file
|
package/cpp.references.cell
CHANGED
|
Binary file
|
package/cpp.runtimetypes.cell
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cpp.staticmembers.cell
CHANGED
|
Binary file
|
package/cpp.streams.cell
CHANGED
|
Binary file
|
package/cpp.templates.cell
CHANGED
|
Binary file
|
package/cpp.userconversions.cell
CHANGED
|
Binary file
|