std::optional specialization for reference types

后端 未结 5 2124
时光取名叫无心
时光取名叫无心 2020-12-06 09:34

Why std::optional (std::experimental::optional in libc++ at the moment) does not have specialization for reference types (compared

5条回答
  •  难免孤独
    2020-12-06 10:14

    When n3406 (revision #2 of the proposal) was discussed, some committee members were uncomfortable with optional references. In n3527 (revision #3), the authors decided to make optional references an auxiliary proposal, to increase the chances of getting optional values approved and put into what became C++14. While optional didn't quite make it into C++14 for various other reasons, the committee did not reject optional references and is free to add optional references in the future should someone propose it.

提交回复
热议问题