Rad Studio Rio 10.3.1, CLANG.
The simple code throws an exception in the assignment operator (y=x): 'std@bad_alloc'
typedef std::variant< std::string, int> MVariant;
MVariant x=10;
MVariant y;
y=x;
I cannot see the reason. What am I missing?
Rad Studio Rio 10.3.1, CLANG.
The simple code throws an exception in the assignment operator (y=x): 'std@bad_alloc'
typedef std::variant< std::string, int> MVariant;
MVariant x=10;
MVariant y;
y=x;
I cannot see the reason. What am I missing?
I think that the problem is not in Rad Studio itself. It is about CLANG. This is known bug 33222 that seems to only affect libstdc++'s std::variant (and other constructs using the same combination). The problem is related to friend function to templates.
The variant from libc++ doesn't seem to use the technique of friends that libstdc++ used.