啥时候能有 constexpr operator ?: 啊,现在非得写个 lambda 里面套
能不能直接搞成类似
if constexpr ,比如[] { if constexpr (A) return B; else return C; }()能不能直接搞成类似
A constexpr? B : C 的样子(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???