ARTICLE AD BOX
It's telling me that there's a redefinition of Get when the assignment operator is called.
https://godbolt.org/z/xYWbrvEPG
template<auto> struct Reader { friend consteval auto Get(Reader); }; template<auto Identifier, class U> struct Writer { friend consteval auto Get(Reader<Identifier>) { return U{}; } }; auto Lambda = [] {}; template<auto Identifier=[] {}> struct Instance { template<class T, auto=Writer<Identifier, T>{}> Instance(T) { } void operator=(Instance<Lambda> const&) {} }; int main() { Instance first(5); Instance<Lambda> second(1.2); first = second; } <source>: In instantiation of 'struct Writer<<lambda closure object><lambda()>(), Instance<<lambda closure object><lambda()>()> >': <source>:17:50: required by substitution of 'template<class T, auto <anonymous> > Instance<<lambda closure object><lambda()>()>::Instance(T) [with T = Instance<<lambda closure object><lambda()>()>; auto <anonymous> = <missing>]' 17 | template<class T, auto=Writer<Identifier, T>{}> | ^ <source>:26:13: required from here 26 | first = second; | ^~~~~~ <source>:10:27: error: redefinition of 'consteval auto Get(Reader<<lambda closure object><lambda()>()>)' 10 | friend consteval auto Get(Reader<Identifier>) { return U{}; } | ^~~ <source>:10:27: note: 'consteval auto Get(Reader<<lambda closure object><lambda()>()>)' previously declared hereApparently, the constructor is being instantiated on that line which evaluates the default argument a second time causing the redefinition. I don't see why it would do that since there's no need to convert the rhs since there's an exact match.
If operator= is replaced with a normal member function, this error disappears.
