@cella-lang/cpp 0.1.202611020538 → 0.1.202611021902

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.
Files changed (48) hide show
  1. package/CHANGES.md +23 -0
  2. package/cpp.arrays.cell +0 -0
  3. package/cpp.cell +0 -0
  4. package/cpp.classes.cell +0 -0
  5. package/cpp.classrules.cell +0 -0
  6. package/cpp.construction.cell +0 -0
  7. package/cpp.constructs.cell +0 -0
  8. package/cpp.copies.cell +0 -0
  9. package/cpp.exceptions.cell +0 -0
  10. package/cpp.inheritance.cell +0 -0
  11. package/cpp.lambdas.cell +0 -0
  12. package/cpp.layouts.cell +0 -0
  13. package/cpp.library.algorithms.cell +0 -0
  14. package/cpp.library.bitsets.cell +0 -0
  15. package/cpp.library.cell +0 -0
  16. package/cpp.library.comparisons.cell +0 -0
  17. package/cpp.library.deques.cell +0 -0
  18. package/cpp.library.iterators.cell +0 -0
  19. package/cpp.library.lists.cell +0 -0
  20. package/cpp.library.maps.cell +0 -0
  21. package/cpp.library.numerics.cell +0 -0
  22. package/cpp.library.pairs.cell +0 -0
  23. package/cpp.library.queues.cell +0 -0
  24. package/cpp.library.sets.cell +0 -0
  25. package/cpp.library.stacks.cell +0 -0
  26. package/cpp.library.strings.cell +0 -0
  27. package/cpp.library.trees.cell +0 -0
  28. package/cpp.library.unorderedmaps.cell +0 -0
  29. package/cpp.library.vectors.cell +0 -0
  30. package/cpp.memberpointers.cell +0 -0
  31. package/cpp.names.cell +0 -0
  32. package/cpp.objects.cell +0 -0
  33. package/cpp.operators.cell +0 -0
  34. package/cpp.overloading.cell +0 -0
  35. package/cpp.polymorphism.cell +0 -0
  36. package/cpp.primitives.cell +0 -0
  37. package/cpp.ranges.cell +0 -0
  38. package/cpp.references.cell +0 -0
  39. package/cpp.runtimetypes.cell +0 -0
  40. package/cpp.standardexceptions.cell +0 -0
  41. package/cpp.standardfunctions.cell +0 -0
  42. package/cpp.standardnames.cell +0 -0
  43. package/cpp.staticmembers.cell +0 -0
  44. package/cpp.streams.cell +0 -0
  45. package/cpp.templates.cell +0 -0
  46. package/cpp.userconversions.cell +0 -0
  47. package/index.json +642 -552
  48. package/package.json +6 -5
package/CHANGES.md CHANGED
@@ -5,6 +5,29 @@
5
5
 
6
6
  ## 未發佈
7
7
 
8
+ - 大括號清單初始化有 `std::initializer_list` 建構子的類別時,選那個建構子([over.match.list]p1):陣列的元素
9
+ (`vector<vector<int>> d = {{4, 1}, {9, 7}}` 背後的陣列、`vector<int> a[2] = {{4, 1}}`)與 `return {4, 1}`。之前內層的
10
+ `{4, 1}` 被當成 `vector<int>(4, 1)` 的引數(安靜的錯答:`d[0].size()` 是 4),三個元素的判 reject。
11
+ 呼叫的引數 `f({4, 1})` 給這種類別時判 unknown(背後的陣列要在運算式之前建,會改變求值順序),不再當成建構引數。
12
+ - `getline` 在乾淨的流上讀不到時先清空字串再失敗([string.io]p9,之前保留原值,安靜的錯答);`cin >> s` 讀不到時照舊不動字串。
13
+ - 函式庫:vector 的 `erase`、`insert`;string 的帶起點 `find`、`rfind`、`find_first_of`/`find_first_not_of`/`find_last_of`/
14
+ `find_last_not_of`、`erase`(位置或迭代器);map 與 unordered_map 的 `erase`(鍵或位置);新的 `<numeric>`(`accumulate`、`iota`、`partial_sum`、
15
+ `gcd`、`lcm`);`unique`;`bitset` 從整數建構。
16
+ - `prev`/`next` 的負格數往反方向走(之前當成 0,安靜的錯答)。
17
+ - C++ 程式裡單獨成句的 `printf("…", …)`、`scanf("…", …)`(`<cstdio>`)照 C 的格式化輸出與輸入(之前判 unknown「printf is not supported yet」)。
18
+ - 函式庫補上 semorphe 回報的誤判 reject(之前判 no matching constructor/no matching member function/invalid operand):`deque(n)`、`deque(n, v)`、
19
+ `deque` 與 `set`/`multiset` 的初始化串列建構子(`set<int> s{5, 1, 9}`)、`bitset` 不帶引數的 `flip()` 與 `operator~`。`cout << b` 的 `operator<<` 已寫進函式庫,但模型推導它的 N 失敗(待查),仍判 reject。
20
+ `pair<int, string> p = make_pair(42, "hello")` 要建構子樣板,模型還沒有,仍判 reject。
21
+ - `std::cin.ignore()`、`ignore(n)`、`ignore(n, delim)`([istream.unformatted]p25;之前判 reject「no member named 'ignore'」):串流的新輸入種類
22
+ `ignoredInput`,丟掉字元到 n 個或遇到 delim(delim 也丟)。
23
+ - `bitset` 的 `&`、`|`、`^`、`<<`、`>>` 與複合指定、`==`、`!=`(之前判 reject「invalid operands」)。
24
+ - 運算結果是 class 的暫時物件時可以呼叫它的成員([class.temporary]p2):一元運算子與自由函式的運算子之前沒有實體化,
25
+ `(~b).to_ulong()`、`(b & c).count()`、`(a + b).size()` 判 reject「expression is not assignable」。
26
+ - class 物件的位元與位移複合指定(`&=`、`|=`、`^=`、`<<=`、`>>=`)呼叫對應的成員運算子;之前只有 `+=` 一類。
27
+ - 函式庫的轉換工具:函式樣板與成員函式樣板也收非型別參數(`template <unsigned long N> ... const bitset<N> &`,之前 N 被當成類別名,推導不出)。
28
+ - `using namespace std` 的撞名表(`cpp.standardnames`)少了 92 個不是 std 的名字:類別的成員寫在類別外的定義(`class locale::id { … }`、
29
+ `numeric_limits::digits`、`ratio::num`)之前被量成 std 的名字,`int id;`、`int num;`、`int seed;`、`int target;` 一類的全域變數判 reject。
30
+ - 純量的大括號初始化:`int a = {5};`、`int b{};`(零)、`for (int i{}; …)`(以運算式的大括號送來)照 [dcl.init.list]p3.9–3.10;之前判 reject 或 unsupported。
8
31
  - 兩個誤判的 reject 改成照標準執行:迭代器一類 class 物件的 `it->first`、`it->f()` 是 `it.operator->()->first`([over.ref]p1;
9
32
  之前判「indirection requires a pointer」);class 的陣列(包括 `vector<pair<int,int>> v = {{1,2}}` 的備用陣列)最內層的大括號是那一個
10
33
  元素的建構子引數(之前拆成兩個元素,判「no matching constructor」)。
package/cpp.arrays.cell CHANGED
Binary file
package/cpp.cell CHANGED
Binary file
package/cpp.classes.cell CHANGED
Binary file
Binary file
Binary file
Binary file
package/cpp.copies.cell CHANGED
Binary file
Binary file
Binary file
package/cpp.lambdas.cell CHANGED
Binary file
package/cpp.layouts.cell CHANGED
Binary file
Binary file
Binary file
package/cpp.library.cell CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/cpp.names.cell CHANGED
Binary file
package/cpp.objects.cell CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
package/cpp.ranges.cell CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/cpp.streams.cell CHANGED
Binary file
Binary file
Binary file