move_as_tuple
とか?
使えたとしても forward_as_tuple と書くのが今度は面倒そう()
構文解析については詳しくないので、 https://ja.wikipedia.org/wiki/LR%E6%B3%95 を読んだのですが、この記事中に
多くのプログラミング言語がLR法(およびそれを一部改変したもの)で構文解析できる。例外として、C++とPerlがある。
との記述がありますね。
A * B ;
とあった際にこの文だけではA
とB
の乗算なのかA*
型の変数B
の宣言なのか区別が付けられないので、一般的な構文解析が出来ない、とどこかで読んだ気がします。
揚げ足を取るような読み方すると、まずn4296 [dcl.ref]/5に
A reference shall be initialized to refer to a valid object or function. [ Note: in particular, a null reference cannot exist in a well-defined program, because the only way to create such a reference would be to bind it to the “object” obtained by indirection through a null pointer, which causes undefined behavior.
というのがあって、じゃぁreferって何ってなるとn4296 [expr.unary.op]/1には
The unary * operator performs indirection: the expression to which it is applied shall be a pointer to an object type, or a pointer to a function type and the result is an lvalue referring to the object or function to which the expression points.
とあるので、nullptrの位置にvalid objectがないことを示せればなんとかUBに持ち込めそう
op->*
とop[]
に関してはそれぞれop.*
とop*
へのequivalenceであることが示されているので割愛