[llvm-dev] Investigating c++2a features
Paul Tait via llvm-dev
llvm-dev at lists.llvm.org
Sun Dec 9 01:59:27 PST 2018
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
error: only special member functions may be defaulted
#include <iostream>
struct foo {
int x;
int operator<=>(const foo&)=default;
};
int main() {
foo f0 = {1}, f1 = {1};
std::cout << ((f0 <=> f1) == 0) << std::endl;
char ch;
std::cin >> ch;
}
Any help appreciated
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181209/5e7a6958/attachment.html>
More information about the llvm-dev
mailing list