This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
17.4.4.4 allows the function specified in the standard to become twoCompletely agreed.
functions, and says that taking the address of a member has unspecified
type since it might have different number of args to the signature given
in the standard. It doesn't say anything about whether explicit
instantiation should be affected. There is one DR for 17.4.4.4 but it
wasn't about this either and was closed as NAD anyway.
Maybe related to the ODR (One-Definition Rule)?AFAICT this effect allows user code to detect whether the implementation provides the exact signature in the standard or multiple equivalent ones, which I didn't think was possible. (Not that "what jon thinks is possible" is in any way normative! :)
14.5(2) and other clauses talk about default arguments in template
functions, but I'm not really sure what it means by "default arguments
... are considered definitions"
14.7.2 [temp.explicit] saysThe same.
-9- An explicit instantiation does not constitute a use of a default argument, so default argument instantiation is not done. [Example:
char* p = 0; template<class T> T g(T = &p); template int g<int>(int); // OK even though &p isn't an int.
--- end example]
(Is that text the same in the final standard? My copies are at home, so
I''m reading a draft now)
That explains why it is OK for a default-constructedAh, thank you so much! I was missing those references!
non-DefaultConstructible type to be used as a default argument
i.e. why this is OK:
I think that working on this is *definitely* desirable. In the meanwhile MartinIf it turns out we're violating the standard in this respect, could we make _M_fill_initialized()'s second parameter default to value_type(), so we can use it like this:
deque(size_type n) { _M_fill_initialized(n); }
It might be possible to move all occurrences of default-ctor calls to default args (I think this is an case where "implementations go to a great deal of effort to make sure that they don't require it by accident" as Matt Austern said.)
I don't know if that's desirable though, and the v3 behaviour might be
OK by the standard anyway.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |