<div dir="ltr"><div dir="ltr">After several years out of c++, I'm getting back into it and a lot has changed. I had to write an equality operator for a large struct the other day and was looking for something (maybe a generator) to write it for me and I came across a post mentioning c++ 20? would do this for free. So I grabbed a copy of Clang 8 and wrote this simple program but I cannot get it to compile. It fails with </div><div dir="ltr"><pre class="gmail-CompilerMessageE" style="box-sizing:border-box;overflow:auto;font-family:"Courier New",monospace;font-size:13px;padding:0px;margin-top:0px;margin-bottom:10px;line-height:1.42857;color:rgb(255,0,0);word-break:break-all;background-color:rgb(0,0,0);border:0px;border-radius:4px;white-space:pre-wrap"><span style="box-sizing:border-box;color:rgb(255,85,85)">error: </span><span style="box-sizing:border-box;color:rgb(255,255,255)">only special member functions may be defaulted</span></pre><div>#include <iostream></div><div><br></div><div>struct foo {</div><div>  int x;</div><div>  int operator<=>(const foo&)=default;</div><div>};</div><div><br></div><div>int main() {</div><div>    foo f0 = {1}, f1 = {1};</div><div>    </div><div>    std::cout << ((f0 <=> f1) == 0) << std::endl;</div><div><br></div><div>    char ch;</div><div>    std::cin >> ch;</div><div>} </div><div> <div dir="ltr" class="gmail_signature"><div></div><div></div><div></div></div></div><div>Any help appreciated</div></div></div>