[PATCH] Proposed change to the constructor of std::pair

Eric Fiselier eric at efcs.ca
Wed Feb 4 12:04:13 PST 2015


In http://reviews.llvm.org/D7384#117826, @eric_niebler wrote:

> Pretty sure defaulted template parameters are used elsewhere already, are they not? Would adding an argument with a default change is_trivial for pairs?


If you have

  pair(std::enable_if<std::is_default_constructible<_T1>::value && std::is_default_constructible<_T2>::value>::type* = 0);

Then pair will fail to instantiate when the enable_if is false, so you still need the `template<bool __b = true>` to make it a template and delay instantiation. However this doesn't work in C++03.


http://reviews.llvm.org/D7384

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list