Namespaces
Variants
Actions

User talk:D41D8CD98F

From cppreference.com

Thanks for fixing a bug in the mini-example for template argument deduction from an overload set! In retrospect, it was pretty dumb error. --Cubbi (talk) 08:43, 20 April 2015 (PDT)

I also made a mistake. I thought P means "the parameter type". Now I realize that P actually means "type to be deduced".--D41D8CD98F (talk)

C17 DRs

regarding your question Should the change made by C17 be treated as DR (and thus applied retroactively to C11)

I'd say yes for most of them, but the ATOMIC_VAR_INIT change is considered to be more significant, at least by the WG14 member who posted that comment to SO. --Cubbi (talk) 11:58, 12 December 2017 (PST)
I see. Thanks for your response. --D41D8CD98F (talk) 00:48, 13 December 2017 (PST)

constexpr rollback

The change you rolled back had a purpose. constexpr, when applied to a variable, is not "possibly" anything; it is very definitely and without question a constant expression (or it's ill-formed). So the form of the statement you restored is misleading. Korval (talk) 20:17, 6 January 2020 (PST)

I think saying a constexpr variable "is a constant expression" is even less correct. It depends on how the variable is used:
void test() {
    constexpr int b = 42;
    constexpr int ib = b;         // OK: the value of b can be used in constant expression
    constexpr const int& rb = b;  // Error: not taking the "value" of b
 
    static const int a = std::random_device{}();
    constexpr const int& ra = a;
    constexpr const int* p = &ra; // OK. The "value" of reference can be thought of as
                                  // the identity of the referenced variable
    constexpr const int  n = ra;  // Error: can't read the referenced variable in
                                  // a constant expression
}
(cpp/language/constant_expression#Constant_expression has a similar example.)
Moreover, the constexpr variable might have a mutable member. Such variable can be used in constant expressions (as long as the mutable member is not accessed), but IMO it doesn't make sense to say that the variable, as a whole, is a constant expression. --D41D8CD98F (talk) 21:47, 6 January 2020 (PST)

typename revert

Hi, I see you reverted my change to typename. I see now that using typename inside casts only works on MSVC, I apologize, I think I misunderstood the relaxed typename rules described in Vandevoorde's book. Without more context though, I could only guess at what you thought was wrong; it would help if you could be more specific next time. For example, in [temp.res] the standard says "A name used in a template declaration or definition and that is dependent on a template-parameter is assumed not to name a type unless the applicable name lookup finds a type name or the name is qualified by the keyword typename." I interpret this as the typename hinting the compiler that something is a typename if name lookup fails.

Jeffythedragonslayer (talk) 20:01, 17 May 2020 (PDT)

Sorry. I thought that you meant static_cast<typename int>(0) is valid, so I thought the problem is too obvious to be noted.
The usage you described has been mentioned in the second and third bullets in cpp/keyword/typename, but the wording can probably be improved. --D41D8CD98F (talk) 23:46, 17 May 2020 (PDT)
Yes, that was exactly what I thought was valid. I'll test on more compilers next time.

Jeffythedragonslayer (talk) 08:10, 18 May 2020 (PDT)