Forwarded from dram :: Channel (dram🎀)
以下哪些是 c++ ub,那些不是?
https://twitter.com/thingskatedid/status/1563270445909942276
int *np = nullptr;
*np
np[0]
np + 0
&np[0]
&*np
std::addressof(*np)
https://twitter.com/thingskatedid/status/1563270445909942276
Twitter
@fayfiftynine @AaronBallman @m_fiftysix > Go for it, thank you for asking!
the tweet above:
> Yup, pointer arithmetic is defined for pointers to complete objects. The null pointer is not a pointer to an object.
> The citations are: C2x 6.5.6p2 and C2x 3.15p1.
the tweet above:
> Yup, pointer arithmetic is defined for pointers to complete objects. The null pointer is not a pointer to an object.
> The citations are: C2x 6.5.6p2 and C2x 3.15p1.
有
有
有
但是没有
is_floating_point 的 type trait,有
floating_point 的 concept;有
is_trivially_copyable 的 type trait,但是没有
trivially_copyable 的 concept???Forwarded from Lancern's Treasure Chest
C++ 标准委员会于11月11日召开了C++26的第二次会议。本次会议新接收了4个核心语言提案、19个标准库提案进入C++26标准。
新接收的重要核心语言提案包括:
- P2662R3 Pack indexing:允许开发者使用数组索引语法提取template parameter pack中的单个元素。
新接收的重要标准库提案包括:
- P1673R13 A free function linear algebra interface based on the BLAS:一个线性代数库,类似于BLAS
- P2905R2 Runtime Format Strings:运行时指定的格式化串
- P2546R5 Debugging Support:一组检测调试器并主动调用调试功能的函数
此外本次会议还进一步讨论了包括Contracts和Reflection在内的其他内容。
https://herbsutter.com/2023/11/11/trip-report-autumn-iso-c-standards-meeting-kona-hi-usa/
新接收的重要核心语言提案包括:
- P2662R3 Pack indexing:允许开发者使用数组索引语法提取template parameter pack中的单个元素。
新接收的重要标准库提案包括:
- P1673R13 A free function linear algebra interface based on the BLAS:一个线性代数库,类似于BLAS
- P2905R2 Runtime Format Strings:运行时指定的格式化串
- P2546R5 Debugging Support:一组检测调试器并主动调用调试功能的函数
此外本次会议还进一步讨论了包括Contracts和Reflection在内的其他内容。
https://herbsutter.com/2023/11/11/trip-report-autumn-iso-c-standards-meeting-kona-hi-usa/
Sutter’s Mill
Trip report: Autumn ISO C++ standards meeting (Kona, HI, USA)
Today, the ISO C++ committee completed its second meeting of C++26, held in Kona, HI, USA. Our hosts, Standard C++ Foundation and WorldQuant, arranged for high-quality facilities for our six-day me…
草,又被 vector<bool> 坑了,lambda 返回类型没特殊标注 bool 结果返回了一个 bit reference,随着 vector 的生命周期一起爆炸了
ranges::transform 等 ranges 系列操作怎么不能配合 execution policy 食用呢???
(看这个更新频率,说明频道主最近在高强度编写现代 C++ 代码!
(看这个更新频率,说明频道主最近在高强度编写现代 C++ 代码!
今日也是希望 gcc 赶快有 deducing this 的一天,原因是写了:
Num operator+(const Num& rhs) const & { ... }
Num operator+(const Num& rhs) && { ... }
Num operator+(Num&& rhs) const & { ... }
Num operator+(Num&& rhs) && { ... }