Can I use the result of a C++17 captureless lambda constexpr conversion operator as a function pointer template non-type argument?

This is a gcc bug, filed 83258. In C++14, we used to have a linkage requirement for non-type template parameters of pointer type. But in C++17 (as a result of N4268), the parameter just needs to be a converted constant expression of the correct type, with a few other restrictions (none of which are relevant … Read more

Rvalues, lvalues and formal definitions

Some preliminary paragraphs first: [basic] 3 An entity is a value, object, reference, function, enumerator, type, class member, template, template specialization, namespace, parameter pack, or this. [dcl.type.simple] 4 The type denoted by decltype(e) is defined as follows: if e is an unparenthesized id-expression or an unparenthesized class member access ([expr.ref]), decltype(e) is the type of … Read more

What changes to C++ made copy initialization work for class with explicit constructor?

Because the behavior of copy elision changes from C++17; for this case copy elision is mandatory. Mandatory elision of copy/move operations Under the following circumstances, the compilers are required to omit the copy and move construction of class objects, even if the copy/move constructor and the destructor have observable side-effects. The objects are constructed directly … Read more